]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/116842 - vectorizer load hosting breaks UID order
authorRichard Biener <rguenther@suse.de>
Sat, 28 Sep 2024 12:02:18 +0000 (14:02 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Sep 2024 05:41:04 +0000 (07:41 +0200)
commit71bf3daa8dabe45aa14e7315195a70ad0d883337
tree2ab306ce5477bb2b562b4c80b85e7eb5a4e240d6
parent85f5d0642184b68b38bf3daee5a1d04b753850b1
tree-optimization/116842 - vectorizer load hosting breaks UID order

The following fixes the case when vectorizing a load hoists an invariant
load and dependent stmts, thereby breaking UID order of said stmts.
While we duplicate the load we just move the dependences.

PR tree-optimization/116842
* tree-vect-stmts.cc (hoist_defs_of_uses): Sort stmts to hoist
after UID to avoid breaking vect_stmt_dominates_stmt_p.

* g++.dg/torture/pr116842.C: New testcase.
gcc/testsuite/g++.dg/torture/pr116842.C [new file with mode: 0644]
gcc/tree-vect-stmts.cc