]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/107690 - avoid creating un-analyzable loop exits
authorRichard Biener <rguenther@suse.de>
Tue, 10 Feb 2026 08:46:08 +0000 (09:46 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 10 Feb 2026 09:59:32 +0000 (10:59 +0100)
commite55de74d50d236db0472431fe242f3244e41b884
tree2bc5da2db945daf314c1a6e6840ba13c11dedddd
parent9eabc86fc6c9b5bba2844ebd6c83ad27026e0766
tree-optimization/107690 - avoid creating un-analyzable loop exits

The following adds a heuristic to ifcombine that avoids turning
analyzable loop exits into unanalyzable ones.  This allows vectorizing
the testcase in the PR again.  I've refrained from actually
analyzing niters but instead used a cheaper heuristic.  I believe
we'll only ever attempt to combine two ifs if they are in the same
loop and if either both exit the loop or stay within.

PR tree-optimization/107690
* tree-ssa-ifcombine.cc (ifcombine_ifandif): Do not merge
possibly analyzable exit conditions.

* g++.dg/vect/vect-pr107690.cc: New testcase.
gcc/testsuite/g++.dg/vect/vect-pr107690.cc [new file with mode: 0644]
gcc/tree-ssa-ifcombine.cc