]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/110221 - SLP and loop mask/len
authorRichard Biener <rguenther@suse.de>
Fri, 10 Nov 2023 11:39:11 +0000 (12:39 +0100)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Fri, 1 Mar 2024 13:40:36 +0000 (13:40 +0000)
commit9d033155254ac6df5f47ab32896dbf336f991589
tree3d97abfa3aada5898c12d88889c80b204dd4884b
parent46c729b03d5201bb5321695d35f3bf1a349496e9
tree-optimization/110221 - SLP and loop mask/len

The following fixes the issue that when SLP stmts are internal defs
but appear invariant because they end up only using invariant defs
then they get scheduled outside of the loop.  This nice optimization
breaks down when loop masks or lens are applied since those are not
explicitly tracked as dependences.  The following makes sure to never
schedule internal defs outside of the vectorized loop when the
loop uses masks/lens.

PR tree-optimization/110221
* tree-vect-slp.cc (vect_schedule_slp_node): When loop
masking / len is applied make sure to not schedule
intenal defs outside of the loop.

* gfortran.dg/pr110221.f: New testcase.

(cherry picked from commit 7c67939ec384425a3d7383dfb4fb39aa7e9ad20a)
gcc/testsuite/gfortran.dg/pr110221.f [new file with mode: 0644]
gcc/tree-vect-slp.cc