aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorAndre Vieira <andre.simoesdiasvieira@arm.com>2020-01-16 10:28:02 +0000
committerAndre Vieira <andre.simoesdiasvieira@arm.com>2020-01-16 10:28:02 +0000
commitf7dff7699fd70d3b8c3e637818e18c86f93ccfec (patch)
treeaf31f070a180f10ce3976fea11218eab523cbd19 /gcc/tree-vect-loop.c
parent3b5757ea87ad2274b841340335bf7536204e615b (diff)
downloadgcc-f7dff7699fd70d3b8c3e637818e18c86f93ccfec.zip
gcc-f7dff7699fd70d3b8c3e637818e18c86f93ccfec.tar.gz
gcc-f7dff7699fd70d3b8c3e637818e18c86f93ccfec.tar.bz2
PR tree-optimization/92429 do not fold when updating epilogue statements
This patch addresses the problem reported in PR92429. When creating an epilogue for vectorization we have to replace the SSA_NAMEs in the PATTERN_DEF_SEQs and RELATED_STMTs of the epilogue's loop_vec_infos. When doing this we were using simplify_replace_tree which always folds the replacement. This may lead to a different tree-node than the one which was analyzed in vect_loop_analyze. In turn the new tree-node may require a different vectorization than the one we had prepared for which caused the ICE in question. gcc/ChangeLog: 2020-01-16 Andre Vieira <andre.simoesdiasvieira@arm.com> PR tree-optimization/92429 * tree-ssa-loop-niter.h (simplify_replace_tree): Add parameter. * tree-ssa-loop-niter.c (simplify_replace_tree): Add parameter to control folding. * tree-vect-loop.c (update_epilogue_vinfo): Do not fold when replacing tree. gcc/testsuite/ChangeLog: 2020-01-16 Andre Vieira <andre.simoesdiasvieira@arm.com> PR tree-optimization/92429 * gcc.dg/vect/pr92429.c: New test.
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 8e318a0..e5fb434 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -8434,8 +8434,13 @@ update_epilogue_loop_vinfo (class loop *epilogue, tree advance)
gimple_set_op (stmt, j, *new_op);
else
{
+ /* PR92429: The last argument of simplify_replace_tree disables
+ folding when replacing arguments. This is required as
+ otherwise you might end up with different statements than the
+ ones analyzed in vect_loop_analyze, leading to different
+ vectorization. */
op = simplify_replace_tree (op, NULL_TREE, NULL_TREE,
- &find_in_mapping, &mapping);
+ &find_in_mapping, &mapping, false);
gimple_set_op (stmt, j, op);
}
}