aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-06-17 14:57:59 +0200
committerRichard Biener <rguenther@suse.de>2020-06-17 15:01:25 +0200
commitd0909f5858ad81e6d8b73fa6193be19cb5e6ed7b (patch)
tree30866025a8611fbc7c0b0d983a73fc96cdf05092 /gcc/tree-vect-loop-manip.c
parent9efbb03616f556dcceabe364f734b5b11fb13587 (diff)
downloadgcc-d0909f5858ad81e6d8b73fa6193be19cb5e6ed7b.zip
gcc-d0909f5858ad81e6d8b73fa6193be19cb5e6ed7b.tar.gz
gcc-d0909f5858ad81e6d8b73fa6193be19cb5e6ed7b.tar.bz2
tree-optimization/95717 - fix SSA update for vectorizer epilogue
This fixes yet another issue with the custom SSA updating in the vectorizer when we copy from the non-if-converted loop. We must not mess with current defs before we updated the BB copies. 2020-06-17 Richard Biener <rguenther@suse.de> PR tree-optimization/95717 * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Move BB SSA updating before exit/latch PHI current def copying. * g++.dg/torture/pr95717.C: New testcase.
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 458a667..169ea64 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -1053,6 +1053,10 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop *loop,
add_phi_args_after_copy (new_bbs, scalar_loop->num_nodes + 1, NULL);
+ /* Skip new preheader since it's deleted if copy loop is added at entry. */
+ for (unsigned i = (at_exit ? 0 : 1); i < scalar_loop->num_nodes + 1; i++)
+ rename_variables_in_bb (new_bbs[i], duplicate_outer_loop);
+
if (scalar_loop != loop)
{
/* If we copied from SCALAR_LOOP rather than LOOP, SSA_NAMEs from
@@ -1130,10 +1134,6 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop *loop,
loop_preheader_edge (new_loop)->src);
}
- /* Skip new preheader since it's deleted if copy loop is added at entry. */
- for (unsigned i = (at_exit ? 0 : 1); i < scalar_loop->num_nodes + 1; i++)
- rename_variables_in_bb (new_bbs[i], duplicate_outer_loop);
-
if (scalar_loop != loop)
{
/* Update new_loop->header PHIs, so that on the preheader