aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-parloops.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-31 14:23:16 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-31 14:23:16 +0000
commit32c91dfcfddc4f3c594aa24e803ee605a259f2a9 (patch)
treed926b51c0c5d09edbb6182739e7f7541adbbdc2c /gcc/tree-parloops.c
parent542ad08cea053ac4a02729e2f37c67bb50019bc0 (diff)
downloadgcc-32c91dfcfddc4f3c594aa24e803ee605a259f2a9.zip
gcc-32c91dfcfddc4f3c594aa24e803ee605a259f2a9.tar.gz
gcc-32c91dfcfddc4f3c594aa24e803ee605a259f2a9.tar.bz2
[17/46] Make LOOP_VINFO_REDUCTIONS an auto_vec<stmt_vec_info>
This patch changes LOOP_VINFO_REDUCTIONS from an auto_vec<gimple *> to an auto_vec<stmt_vec_info>. It also changes the associated vect_force_simple_reduction so that it takes and returns stmt_vec_infos instead of gimple stmts. 2018-07-31 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (_loop_vec_info::reductions): Change from an auto_vec<gimple *> to an auto_vec<stmt_vec_info>. (vect_force_simple_reduction): Take and return stmt_vec_infos rather than gimple stmts. * tree-parloops.c (valid_reduction_p): Take a stmt_vec_info instead of a gimple stmt. (gather_scalar_reductions): Update after above interface changes. * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise. (vect_is_simple_reduction): Take and return stmt_vec_infos rather than gimple stmts. (vect_force_simple_reduction): Likewise. * tree-vect-patterns.c (vect_pattern_recog_1): Update use of LOOP_VINFO_REDUCTIONS. * tree-vect-slp.c (vect_analyze_slp_instance): Likewise. From-SVN: r263132
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r--gcc/tree-parloops.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index e79a954..5133054 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2570,15 +2570,14 @@ set_reduc_phi_uids (reduction_info **slot, void *data ATTRIBUTE_UNUSED)
return 1;
}
-/* Return true if the type of reduction performed by STMT is suitable
+/* Return true if the type of reduction performed by STMT_INFO is suitable
for this pass. */
static bool
-valid_reduction_p (gimple *stmt)
+valid_reduction_p (stmt_vec_info stmt_info)
{
/* Parallelization would reassociate the operation, which isn't
allowed for in-order reductions. */
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
vect_reduction_type reduc_type = STMT_VINFO_REDUC_TYPE (stmt_info);
return reduc_type != FOLD_LEFT_REDUCTION;
}
@@ -2615,10 +2614,11 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
if (simple_iv (loop, loop, res, &iv, true))
continue;
- gimple *reduc_stmt
- = vect_force_simple_reduction (simple_loop_info, phi,
+ stmt_vec_info reduc_stmt_info
+ = vect_force_simple_reduction (simple_loop_info,
+ simple_loop_info->lookup_stmt (phi),
&double_reduc, true);
- if (!reduc_stmt || !valid_reduction_p (reduc_stmt))
+ if (!reduc_stmt_info || !valid_reduction_p (reduc_stmt_info))
continue;
if (double_reduc)
@@ -2627,11 +2627,11 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
continue;
double_reduc_phis.safe_push (phi);
- double_reduc_stmts.safe_push (reduc_stmt);
+ double_reduc_stmts.safe_push (reduc_stmt_info->stmt);
continue;
}
- build_new_reduction (reduction_list, reduc_stmt, phi);
+ build_new_reduction (reduction_list, reduc_stmt_info->stmt, phi);
}
delete simple_loop_info;
@@ -2661,12 +2661,15 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
&iv, true))
continue;
- gimple *inner_reduc_stmt
- = vect_force_simple_reduction (simple_loop_info, inner_phi,
+ stmt_vec_info inner_phi_info
+ = simple_loop_info->lookup_stmt (inner_phi);
+ stmt_vec_info inner_reduc_stmt_info
+ = vect_force_simple_reduction (simple_loop_info,
+ inner_phi_info,
&double_reduc, true);
gcc_assert (!double_reduc);
- if (inner_reduc_stmt == NULL
- || !valid_reduction_p (inner_reduc_stmt))
+ if (!inner_reduc_stmt_info
+ || !valid_reduction_p (inner_reduc_stmt_info))
continue;
build_new_reduction (reduction_list, double_reduc_stmts[i], phi);