aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-31 14:21:45 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-31 14:21:45 +0000
commitc98d05955ba54fcdbae37f2a9e81b8cca6f1ca59 (patch)
tree95f219682b2ae0c794bd3e824106dcd8939d555c /gcc/tree-vect-stmts.c
parent6585ff8f3a55bbfed6a4f2c2addac7a27ed087d3 (diff)
downloadgcc-c98d05955ba54fcdbae37f2a9e81b8cca6f1ca59.zip
gcc-c98d05955ba54fcdbae37f2a9e81b8cca6f1ca59.tar.gz
gcc-c98d05955ba54fcdbae37f2a9e81b8cca6f1ca59.tar.bz2
[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 <richard.sandiford@arm.com> 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
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 2aca038..8f4b66d 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -10092,11 +10092,11 @@ vect_is_simple_use (tree operand, vec_info *vinfo, enum vect_def_type *dt,
else
{
gimple *def_stmt = SSA_NAME_DEF_STMT (operand);
- if (! vect_stmt_in_region_p (vinfo, def_stmt))
+ stmt_vec_info stmt_vinfo = vinfo->lookup_def (operand);
+ if (!stmt_vinfo)
*dt = vect_external_def;
else
{
- stmt_vec_info stmt_vinfo = vinfo_for_stmt (def_stmt);
if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo))
{
def_stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo);