aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-08-09 14:45:02 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-08-09 14:45:02 +0000
commit3dec9a89d480616a4c11454f4ef4030d15a49773 (patch)
treeab3a8afd1b389e9c60c52af8406d314350049cee /gcc/tree-vect-loop.c
parent4beb66421fe0e19d3310c75af3502018119423c6 (diff)
downloadgcc-3dec9a89d480616a4c11454f4ef4030d15a49773.zip
gcc-3dec9a89d480616a4c11454f4ef4030d15a49773.tar.gz
gcc-3dec9a89d480616a4c11454f4ef4030d15a49773.tar.bz2
Restore flow_bb_inside_loop_p tests (PR 86858)
The series to remove vinfo_for_stmt also removed tests of flow_bb_inside_loop_p if the call was simply testing whether the statement was in the vectorisation region. I'd tried to keep calls that were testing whether the statement was in a particular loop (inner or outer), but messed up in vect_is_simple_reduction and removed calls that were actually needed. This patch restores them. I double-checked the other removed calls and I think these are the only ones affected. 2018-08-08 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR tree-optimization/86858 * tree-vect-loop.c (vect_is_simple_reduction): Restore flow_bb_inside_loop_p calls. gcc/testsuite/ PR tree-optimization/86858 * gcc.dg/vect/pr86858.c: New test. From-SVN: r263448
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 92c01a2..0669f62 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2922,7 +2922,8 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info,
}
stmt_vec_info def_stmt_info = loop_info->lookup_def (loop_arg);
- if (!def_stmt_info)
+ if (!def_stmt_info
+ || !flow_bb_inside_loop_p (loop, gimple_bb (def_stmt_info->stmt)))
return NULL;
if (gassign *def_stmt = dyn_cast <gassign *> (def_stmt_info->stmt))
@@ -3161,6 +3162,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info,
&& def2_info->stmt == phi
&& (code == COND_EXPR
|| !def1_info
+ || !flow_bb_inside_loop_p (loop, gimple_bb (def1_info->stmt))
|| vect_valid_reduction_input_p (def1_info)))
{
if (dump_enabled_p ())
@@ -3172,6 +3174,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info,
&& def1_info->stmt == phi
&& (code == COND_EXPR
|| !def2_info
+ || !flow_bb_inside_loop_p (loop, gimple_bb (def2_info->stmt))
|| vect_valid_reduction_input_p (def2_info)))
{
if (! nested_in_vect_loop && orig_code != MINUS_EXPR)