]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Fix dominators when adding a guard to skip the vector loop [PR118211]
authorTamar Christina <Tamar.Christina@arm.com>
Mon, 8 Jul 2024 11:16:11 +0000 (12:16 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 10 Jan 2025 21:21:06 +0000 (21:21 +0000)
commitf1c6789ab6c5443ccefab96c74b0e862119d1781
tree071d7b11b98f4cce5a9151795663ef8810982485
parent0a46245174123ad2802753e7fee689a541570ca0
vect: Fix dominators when adding a guard to skip the vector loop [PR118211]

The alignment peeling changes exposed a latent missing dominator update
with early break vectorization, specifically when inserting the vector
skip edge, since the new edge bypasses the prolog skip block and thus
has the potential to subvert its dominance.  This patch fixes that.

gcc/ChangeLog:

PR tree-optimization/118211
PR tree-optimization/116126
* tree-vect-loop-manip.cc (vect_do_peeling): Update immediate
dominators of nodes that were dominated by the prolog skip block
after inserting vector skip edge.  Initialize prolog variable to
NULL to avoid bogus -Wmaybe-uninitialized during bootstrap.

gcc/testsuite/ChangeLog:

PR tree-optimization/118211
PR tree-optimization/116126
* g++.dg/vect/vect-early-break_6.cc: New test.

Co-Authored-By: Alex Coplan <alex.coplan@arm.com>
gcc/testsuite/g++.dg/vect/vect-early-break_6.cc [new file with mode: 0644]
gcc/tree-vect-loop-manip.cc