summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vect-analyze.c28
2 files changed, 26 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dd704f95db8..031ab57bc5e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-15 Andrew MacLeod <amacleod@redhat.com>
+
+ * tree-vect-analyze.c (vect_stmt_relevant_p): Process immediate uses
+ of non-virtual PHI nodes like we use to.
+
2005-05-15 Paolo Bonzini <bonzini@gnu.org>
* genattrtab.c (ATTR_EQ_ATTR_P): Remove.
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 6ece91d1eff..46d76731f44 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -2126,16 +2126,30 @@ vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo)
return true;
/* changing memory. */
- if (TREE_CODE (stmt) != PHI_NODE)
+ if (TREE_CODE (stmt) == PHI_NODE)
{
- v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
- v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
- if (v_may_defs || v_must_defs)
+ if (!is_gimple_reg (PHI_RESULT (stmt)))
+ return false;
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, PHI_RESULT (stmt))
{
- if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
- fprintf (vect_dump, "vec_stmt_relevant_p: stmt has vdefs.");
- return true;
+ basic_block bb = bb_for_stmt (USE_STMT (use_p));
+ if (!flow_bb_inside_loop_p (loop, bb))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "vec_stmt_relevant_p: used out of loop.");
+ return true;
+ }
}
+ return false;
+ }
+
+ v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
+ v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
+ if (v_may_defs || v_must_defs)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "vec_stmt_relevant_p: stmt has vdefs.");
+ return true;
}
/* uses outside the loop. */