From c98d05955ba54fcdbae37f2a9e81b8cca6f1ca59 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 31 Jul 2018 14:21:45 +0000 Subject: [08/46] Add vec_info::lookup_def This patch adds a vec_info helper for checking whether an operand is an SSA_NAME that is defined in the vectorisable region. 2018-07-31 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::lookup_def): Declare. * tree-vectorizer.c (vec_info::lookup_def): New function. * tree-vect-patterns.c (vect_get_internal_def): Use it. (vect_widened_op_tree): Likewise. * tree-vect-stmts.c (vect_is_simple_use): Likewise. * tree-vect-loop.c (vect_analyze_loop_operations): Likewise. (vectorizable_reduction): Likewise. (vect_valid_reduction_input_p): Take a stmt_vec_info instead of a gimple *. (vect_is_slp_reduction): Update calls accordingly. Use vec_info::lookup_def. (vect_is_simple_reduction): Likewise * tree-vect-slp.c (vect_detect_hybrid_slp_1): Use vec_info::lookup_def. From-SVN: r263123 --- gcc/tree-vect-slp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gcc/tree-vect-slp.c') diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 631a076..78aaa71 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2389,11 +2389,8 @@ vect_detect_hybrid_slp_1 (tree *tp, int *, void *data) if (wi->is_lhs) return NULL_TREE; - stmt_vec_info def_stmt_info; - if (TREE_CODE (*tp) == SSA_NAME - && !SSA_NAME_IS_DEFAULT_DEF (*tp) - && (def_stmt_info = loop_vinfo->lookup_stmt (SSA_NAME_DEF_STMT (*tp))) - && PURE_SLP_STMT (def_stmt_info)) + stmt_vec_info def_stmt_info = loop_vinfo->lookup_def (*tp); + if (def_stmt_info && PURE_SLP_STMT (def_stmt_info)) { if (dump_enabled_p ()) { -- cgit v1.1