aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 7b3d9a3..41e87a8 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -350,6 +350,33 @@ vect_destroy_datarefs (vec_info *vinfo)
}
+/* Return whether STMT is inside the region we try to vectorize. */
+
+bool
+vect_stmt_in_region_p (vec_info *vinfo, gimple *stmt)
+{
+ if (!gimple_bb (stmt))
+ return false;
+
+ if (loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo))
+ {
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
+ if (!flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
+ return false;
+ }
+ else
+ {
+ bb_vec_info bb_vinfo = as_a <bb_vec_info> (vinfo);
+ if (gimple_bb (stmt) != BB_VINFO_BB (bb_vinfo)
+ || gimple_uid (stmt) == -1U
+ || gimple_code (stmt) == GIMPLE_PHI)
+ return false;
+ }
+
+ return true;
+}
+
+
/* If LOOP has been versioned during ifcvt, return the internal call
guarding it. */
@@ -692,6 +719,14 @@ pass_slp_vectorize::execute (function *fun)
scev_initialize ();
}
+ /* Mark all stmts as not belonging to the current region. */
+ FOR_EACH_BB_FN (bb, fun)
+ {
+ for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ gimple_set_uid (gsi_stmt (gsi), -1);
+ }
+
init_stmt_vec_info_vec ();
FOR_EACH_BB_FN (bb, fun)