]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/114792 - order loops to unloops in CH
authorRichard Biener <rguenther@suse.de>
Thu, 25 Apr 2024 06:08:24 +0000 (08:08 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 25 Apr 2024 13:20:25 +0000 (15:20 +0200)
commit59ff81835fee22a9d4c9a481a4d1814583aae945
tree2a4ad9ebedd0989500a60103e86d383bd3a4d1ea
parent1d238c84025aaef1641e4000bd2a8f4328b474dd
tree-optimization/114792 - order loops to unloops in CH

When we use unloop_loops we have to make sure to have loops ordered
inner to outer as otherwise we can wreck inner loop structure where
unlooping relies on that being intact.  The following re-sorts the
vector of to unloop loops after copy-header as that adds to the
vector in two places and the wrong order.

PR tree-optimization/114792
* tree-ssa-loop-ch.cc (ch_order_loops): New function.
(ch_base::copy_headers): Sort loops to unloop inner-to-outer.

* gcc.dg/torture/pr114792.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr114792.c [new file with mode: 0644]
gcc/tree-ssa-loop-ch.cc