]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end: prevent LIM from hoising vector compares from gconds if target does not...
authorTamar Christina <tamar.christina@arm.com>
Sun, 24 Dec 2023 19:17:13 +0000 (19:17 +0000)
committerTamar Christina <tamar.christina@arm.com>
Sun, 24 Dec 2023 19:17:13 +0000 (19:17 +0000)
commitf1dcc0fe371e3cb10d2cbe3f6c88db6f72edddda
tree52b2945778b46c2976c2db5e4e316bce13aa98db
parent0994ddd86f9c3d829b06009d9e706ff72b07001a
middle-end: prevent LIM from hoising vector compares from gconds if target does not support it.

LIM notices that in some cases the condition and the results are loop
invariant and tries to move them out of the loop.

While the resulting code is operationally sound, moving the compare out of the
gcond results in generating code that no longer branches, so cbranch is no
longer applicable.  As such I now add code to check during this motion to see
if the target supports flag setting vector comparison as general operation.

I have tried writing a GIMPLE testcase for this but the gimple FE seems to be
having some trouble with the vector types.  It seems to fail parsing.

The early break code testsuite however has a test for this
(vect-early-break_67.c).

gcc/ChangeLog:

* tree-ssa-loop-im.cc (determine_max_movement): Import insn-codes.h
and optabs-tree.h and check for vector compare motion out of gcond.
gcc/tree-ssa-loop-im.cc