]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/109025 - fixup double reduction detection
authorRichard Biener <rguenther@suse.de>
Mon, 6 Mar 2023 09:43:13 +0000 (10:43 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 6 Mar 2023 10:26:19 +0000 (11:26 +0100)
commitc1873079b05e399355eb79e4828ed9ba2d0c6968
tree3101c0a728fce20121788d8e9097528bb9a8b0ec
parentb83acefb0409056b566133f66843ead6c04b8474
tree-optimization/109025 - fixup double reduction detection

The following closes a gap in double reduction detection where we
in the outer loop analysis fail to verify the inner LC PHI use is
the latch definition of the inner loop PHI.  That latch definition
is used to detect that an inner loop is part of a double reduction
when later doing the inner loop analysis.

PR tree-optimization/109025
* tree-vect-loop.cc (vect_is_simple_reduction): Verify
the inner LC PHI use is the inner loop PHI latch definition
before classifying an outer PHI as double reduction.

* gcc.dg/vect/pr109025.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr109025.c [new file with mode: 0644]
gcc/tree-vect-loop.cc