From 6e6b18e5fbe6be62334c9007a58224fb3700d43a Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 1 Aug 2018 15:14:42 +0000 Subject: [05/11] Add a vect_stmt_to_vectorize helper function This patch adds a helper that does the opposite of vect_orig_stmt: go from the original scalar statement to the statement that should actually be vectorised. The use in the last two hunks of vectorizable_reduction are because reduc_stmt_info (first hunk) and stmt_info (second hunk) are already pattern statements if appropriate. 2018-08-01 Richard Sandiford gcc/ * tree-vectorizer.h (vect_stmt_to_vectorize): New function. * tree-vect-loop.c (vect_update_vf_for_slp): Use it. (vectorizable_reduction): Likewise. * tree-vect-slp.c (vect_analyze_slp_instance): Likewise. (vect_detect_hybrid_slp_stmts): Likewise. * tree-vect-stmts.c (vect_is_simple_use): Likewise. From-SVN: r263219 --- gcc/tree-vect-stmts.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index f3a2d80..9d51c10 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -10031,11 +10031,8 @@ vect_is_simple_use (tree operand, vec_info *vinfo, enum vect_def_type *dt, *dt = vect_external_def; else { - if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo)) - { - stmt_vinfo = STMT_VINFO_RELATED_STMT (stmt_vinfo); - def_stmt = stmt_vinfo->stmt; - } + stmt_vinfo = vect_stmt_to_vectorize (stmt_vinfo); + def_stmt = stmt_vinfo->stmt; switch (gimple_code (def_stmt)) { case GIMPLE_PHI: -- cgit v1.1