OSDN Git Service

2005-04-15 Andrew MacLeod <amacleod@redhat.com>
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Apr 2005 16:40:51 +0000 (16:40 +0000)
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Apr 2005 16:40:51 +0000 (16:40 +0000)
* tree-vect-analyze.c (vect_stmt_relevant_p): Process immediate uses
of non-virtual PHI nodes like we use to.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98192 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-vect-analyze.c

index dd704f9..031ab57 100644 (file)
@@ -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.
index 6ece91d..46d7673 100644 (file)
@@ -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.  */