aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-31 14:23:57 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-31 14:23:57 +0000
commitbeb456c375ea71d57e35400e9b7107e09e996965 (patch)
treec6abc11910ddc42f2e70b359901386fc2adcb87b /gcc/tree-vect-loop.c
parent95c68311b61f6bbb013d0eb2e4403f01c76bf622 (diff)
downloadgcc-beb456c375ea71d57e35400e9b7107e09e996965.zip
gcc-beb456c375ea71d57e35400e9b7107e09e996965.tar.gz
gcc-beb456c375ea71d57e35400e9b7107e09e996965.tar.bz2
[26/46] Make more use of dyn_cast in tree-vect*
If we use stmt_vec_infos to represent statements in the vectoriser, it's then more natural to use dyn_cast when processing the statement as an assignment, call, etc. This patch does that in a few more places. 2018-07-31 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-data-refs.c (vect_check_gather_scatter): Pass the gcall rather than the generic gimple stmt to gimple_call_internal_fn. (vect_get_smallest_scalar_type, can_group_stmts_p): Use dyn_cast to get gassigns and gcalls, rather than operating on generc gimple stmts. * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p) (vect_mark_stmts_to_be_vectorized, vectorizable_store) (vectorizable_load, vect_analyze_stmt): Likewise. * tree-vect-loop.c (vectorizable_reduction): Likewise gphi. From-SVN: r263141
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index f6b2b45..caa1c6b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -6109,9 +6109,9 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
gcc_assert (slp_node
&& REDUC_GROUP_FIRST_ELEMENT (stmt_info) == stmt_info);
- if (gimple_code (stmt) == GIMPLE_PHI)
+ if (gphi *phi = dyn_cast <gphi *> (stmt))
{
- tree phi_result = gimple_phi_result (stmt);
+ tree phi_result = gimple_phi_result (phi);
/* Analysis is fully done on the reduction stmt invocation. */
if (! vec_stmt)
{
@@ -6141,7 +6141,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
for (unsigned k = 1; k < gimple_num_ops (reduc_stmt); ++k)
{
tree op = gimple_op (reduc_stmt, k);
- if (op == gimple_phi_result (stmt))
+ if (op == phi_result)
continue;
if (k == 1
&& gimple_assign_rhs_code (reduc_stmt) == COND_EXPR)