OSDN Git Service

2009-10-09 Sebastian Pop <sebastian.pop@amd.com>
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Nov 2009 04:58:45 +0000 (04:58 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Nov 2009 04:58:45 +0000 (04:58 +0000)
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence): Do
not replace cross BB scalar dependences ending on PHI nodes.
(rewrite_cross_bb_scalar_deps): Filter out GIMPLE_PHI nodes.

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

gcc/ChangeLog.graphite
gcc/graphite-sese-to-poly.c

index 388b4fd..3102f22 100644 (file)
@@ -1,5 +1,11 @@
 2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
 
+       * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence): Do
+       not replace cross BB scalar dependences ending on PHI nodes.
+       (rewrite_cross_bb_scalar_deps): Filter out GIMPLE_PHI nodes.
+
+2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
+
        * graphite-poly.c (apply_poly_transforms): Implement the high
        level driver for flag_loop_block.
        * tree-ssa-loop.c (gate_graphite_transforms): Remove call to sorry for
index 24e79cf..f8ecbae 100644 (file)
@@ -2089,39 +2089,16 @@ rewrite_cross_bb_scalar_dependence (tree zero_dim_array, tree def, gimple use_st
   use_operand_p use_p;
   gimple_stmt_iterator gsi;
 
-  gimple_assign_set_lhs (name_stmt, name);
-
-  if (gimple_code (use_stmt) == GIMPLE_PHI)
-    {
-      gimple phi = use_stmt;
-      edge entry;
-      unsigned i;
+  gcc_assert (gimple_code (use_stmt) != GIMPLE_PHI);
 
-      for (i = 0; i < gimple_phi_num_args (phi); i++)
-       if (operand_equal_p (def, gimple_phi_arg_def (phi, i), 0))
-         {
-           entry = gimple_phi_arg_edge (phi, i);
-           break;
-         }
+  gimple_assign_set_lhs (name_stmt, name);
 
-      FOR_EACH_PHI_ARG (use_p, phi, iter, SSA_OP_USE)
-       if (operand_equal_p (def, USE_FROM_PTR (use_p), 0))
-         {
-           gsi = gsi_last_bb (entry->src);
-           gsi_insert_after (&gsi, name_stmt, GSI_NEW_STMT);
-           SET_USE (use_p, name);
-           break;
-         }
-    }
-  else
-    {
-      gsi = gsi_for_stmt (use_stmt);
-      gsi_insert_before (&gsi, name_stmt, GSI_NEW_STMT);
+  gsi = gsi_for_stmt (use_stmt);
+  gsi_insert_before (&gsi, name_stmt, GSI_NEW_STMT);
 
-      FOR_EACH_SSA_USE_OPERAND (use_p, use_stmt, iter, SSA_OP_ALL_USES)
-       if (operand_equal_p (def, USE_FROM_PTR (use_p), 0))
-         replace_exp (use_p, name);
-    }
+  FOR_EACH_SSA_USE_OPERAND (use_p, use_stmt, iter, SSA_OP_ALL_USES)
+    if (operand_equal_p (def, USE_FROM_PTR (use_p), 0))
+      replace_exp (use_p, name);
 
   update_stmt (use_stmt);
 }
@@ -2150,7 +2127,8 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
   def_bb = gimple_bb (stmt);
 
   FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
-    if (def_bb != gimple_bb (use_stmt))
+    if (def_bb != gimple_bb (use_stmt)
+       && gimple_code (use_stmt) != GIMPLE_PHI)
       {
        if (!zero_dim_array)
          {