]> git.ipfire.org Git - thirdparty/gcc.git/commit
slp: Fix handling of IFN_CLZ/CTZ [PR112536]
authorJakub Jelinek <jakub@redhat.com>
Thu, 16 Nov 2023 07:32:24 +0000 (08:32 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 16 Nov 2023 07:32:24 +0000 (08:32 +0100)
commit9f35d8cd767155e9c24f5ef0944168711d38bc6b
tree84233632480a7dd5241fe2a60cbf4b44283ceb76
parent31bf21c78029434b7515a94477ce3565bff0743f
slp: Fix handling of IFN_CLZ/CTZ [PR112536]

We ICE on the following testcase now that IFN_C[LT]Z calls can have one or
two arguments (where 2 mean it is well defined at zero).
The following patch makes us create child node only for the first argument
and compatible_calls_p ensures the other argument is the same, which
at least according to the testcase seems sufficient because of vect
patterns.

2023-11-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/112536
* tree-vect-slp.cc (arg0_map): New variable.
(vect_get_operand_map): For IFN_CLZ or IFN_CTZ, return arg0_map.

* gcc.dg/pr112536.c: New test.
gcc/testsuite/gcc.dg/pr112536.c [new file with mode: 0644]
gcc/tree-vect-slp.cc