tree-optimization/104543 - fix unroll-and-jam precondition
authorRichard Biener <rguenther@suse.de>
Tue, 15 Feb 2022 11:27:14 +0000 (12:27 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 15 Feb 2022 12:22:15 +0000 (13:22 +0100)
commitd03a67dc69251dc86c0772a432380a6e9bcb8617
tree751d42d3e61a78d5aa8d25fc1d77a05cc9c78ab3
parent3939c1b11279dc950d2f160eb940dd791f7b40f1
tree-optimization/104543 - fix unroll-and-jam precondition

We have to make sure that outer loop exits come after the inner
loop since we otherwise will put it into the fused loop body.

2022-02-15  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104543
* gimple-loop-jam.cc (unroll_jam_possible_p): Check outer loop exits
come after the inner loop.

* gcc.dg/torture/pr104543.c: New testcase.
gcc/gimple-loop-jam.cc
gcc/testsuite/gcc.dg/torture/pr104543.c [new file with mode: 0644]