]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/122308 - apply LIM after unroll-and-jam
authorRichard Biener <rguenther@suse.de>
Fri, 17 Oct 2025 13:12:11 +0000 (15:12 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 17 Oct 2025 14:03:28 +0000 (16:03 +0200)
commitd6986e06db5eeb797344d86bd3ef9b0654606bbd
treee24b5a02f96aacbe1f809bbd452517417524537c
parent7cd91c7c42eec894c8c13fa68ccc12ec3a047c9a
tree-optimization/122308 - apply LIM after unroll-and-jam

Just like with loop interchange, unroll-and-jam can leave invariant
stmts in the inner loop from outer loop stmts inbetween the two
inner loop copies.  Do a per-function invariant motion when we
applied unroll-and-jam.  This avoids failed dataref analysis
and fallback to gather/scatter during vectorization.

PR tree-optimization/122308
* gimple-loop-jam.cc (tree_loop_unroll_and_jam): Do LIM
after applying unroll-and-jam.

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