]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end: check explicitly for external or constants when checking for loop invaria...
authorTamar Christina <tamar.christina@arm.com>
Mon, 30 Sep 2024 12:06:24 +0000 (13:06 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 30 Sep 2024 12:06:24 +0000 (13:06 +0100)
commit87905f63a6521eef1f38082e2368e18c637ef092
tree4546cb40085793bc85fe20b0a800fbc440532cdc
parentbac95615b50d4a012c448cba080c106702184e3a
middle-end: check explicitly for external or constants when checking for loop invariant [PR116817]

The previous check if a value was external was checking
!vect_get_internal_def (vinfo, var) but this of course isn't completely right
as they could reductions etc.

This changes the check to just explicitly look at externals and constants.
Note that reductions remain unhandled here, but we don't support codegen of
boolean reductions today anyway.

So at the time we do then this would have the be handled as well in lowering.

gcc/ChangeLog:

PR tree-optimization/116817
* tree-vect-patterns.cc (vect_recog_bool_pattern): Check for const or
externals.

gcc/testsuite/ChangeLog:

PR tree-optimization/116817
* g++.dg/vect/pr116817.cc: New test.
gcc/testsuite/g++.dg/vect/pr116817.cc [new file with mode: 0644]
gcc/tree-vect-patterns.cc