]> gcc.gnu.org Git - gcc.git/commit
ifcvt: Support bitfield lowering of multiple-exit loops
authorTamar Christina <tamar.christina@arm.com>
Fri, 20 Oct 2023 07:09:45 +0000 (08:09 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 20 Oct 2023 07:09:45 +0000 (08:09 +0100)
commit88c27070c253094fb7e366583fbe09cec2371e8b
tree65ec1367890d608e2b72aa29f56f04cb6cc4d8e1
parentdd3e6f52e406a0bab787aebcb384ef6e2cf7a1e8
ifcvt: Support bitfield lowering of multiple-exit loops

With the patch enabling the vectorization of early-breaks, we'd like to allow
bitfield lowering in such loops, which requires the relaxation of allowing
multiple exits when doing so.  In order to avoid a similar issue to PR107275,
the code that rejects loops with certain types of gimple_stmts was hoisted from
'if_convertible_loop_p_1' to 'get_loop_body_in_if_conv_order', to avoid trying
to lower bitfields in loops we are not going to vectorize anyway.

This also ensures 'ifcvt_local_dec' doesn't accidentally remove statements it
shouldn't as it will never come across them.  I made sure to add a comment to
make clear that there is a direct connection between the two and if we were to
enable vectorization of any other gimple statement we should make sure both
handle it.

gcc/ChangeLog:

* tree-if-conv.cc (if_convertible_loop_p_1): Move check from here ...
(get_loop_body_if_conv_order): ... to here.
(if_convertible_loop_p): Remove single_exit check.
(tree_if_conversion): Move single_exit check to if-conversion part and
support multiple exits.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-bitfield-read-1-not.c: New test.
* gcc.dg/vect/vect-bitfield-read-2-not.c: New test.
* gcc.dg/vect/vect-bitfield-read-8.c: New test.
* gcc.dg/vect/vect-bitfield-read-9.c: New test.

Co-Authored-By: Andre Vieira <andre.simoesdiasvieira@arm.com>
gcc/testsuite/gcc.dg/vect/vect-bitfield-read-1-not.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-bitfield-read-2-not.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-bitfield-read-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-bitfield-read-9.c [new file with mode: 0644]
gcc/tree-if-conv.cc
This page took 0.07598 seconds and 5 git commands to generate.