diff options
author | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-01 13:52:13 +0000 |
---|---|---|
committer | irar <irar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-01 13:52:13 +0000 |
commit | a11230474b3b7422c5de43d34c0dfd59f2ed1fdf (patch) | |
tree | 39604a554502660fbe8328eaba9da6d7ec6570a3 /gcc/tree-vect-slp.c | |
parent | ba4ed0263107863f892975257665afbb88d80ce6 (diff) | |
download | gcc-a11230474b3b7422c5de43d34c0dfd59f2ed1fdf.tar.gz |
PR tree-optimization/51704
* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Check that
a use is inside the basic block or loop before accessing its
vect info.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 91ed0c70634..ab1914afc62 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1,5 +1,5 @@ /* SLP - Basic Block Vectorization - Copyright (C) 2007, 2008, 2009, 2010, 2011 + Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Dorit Naishlos <dorit@il.ibm.com> and Ira Rosen <irar@il.ibm.com> @@ -1727,26 +1727,39 @@ static void vect_detect_hybrid_slp_stmts (slp_tree node) { int i; - gimple stmt; + VEC (gimple, heap) *stmts = SLP_TREE_SCALAR_STMTS (node); + gimple stmt = VEC_index (gimple, stmts, 0); imm_use_iterator imm_iter; gimple use_stmt; - stmt_vec_info stmt_vinfo; + stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt); slp_void_p child; + loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); + struct loop *loop = NULL; + bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo); + basic_block bb = NULL; if (!node) return; + if (loop_vinfo) + loop = LOOP_VINFO_LOOP (loop_vinfo); + else + bb = BB_VINFO_BB (bb_vinfo); + FOR_EACH_VEC_ELT (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt) if (PURE_SLP_STMT (vinfo_for_stmt (stmt)) && TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME) FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, gimple_op (stmt, 0)) - if ((stmt_vinfo = vinfo_for_stmt (use_stmt)) + if (gimple_bb (use_stmt) + && ((loop && flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))) + || bb == gimple_bb (use_stmt)) + && (stmt_vinfo = vinfo_for_stmt (use_stmt)) && !STMT_SLP_TYPE (stmt_vinfo) && (STMT_VINFO_RELEVANT (stmt_vinfo) || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))) - && !(gimple_code (use_stmt) == GIMPLE_PHI - && STMT_VINFO_DEF_TYPE (vinfo_for_stmt (use_stmt)) - == vect_reduction_def)) + && !(gimple_code (use_stmt) == GIMPLE_PHI + && STMT_VINFO_DEF_TYPE (stmt_vinfo) + == vect_reduction_def)) vect_mark_slp_stmts (node, hybrid, i); FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child) |