OSDN Git Service

2009-10-15 Sebastian Pop <sebastian.pop@amd.com>
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Nov 2009 05:08:09 +0000 (05:08 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Nov 2009 05:08:09 +0000 (05:08 +0000)
* graphite-sese-to-poly.c (insert_copyin): Use gsi_insert_seq_on_edge.
(rewrite_commutative_reductions_out_of_ssa): Call gsi_commit_edge_inserts,
and check the SSA representation.

* gfortran.dg/graphite/id-18.f90: New, reduced from PR41193.

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

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

index fd86beb..3a0779c 100644 (file)
@@ -1,5 +1,13 @@
 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
 
 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
 
+       * graphite-sese-to-poly.c (insert_copyin): Use gsi_insert_seq_on_edge.
+       (rewrite_commutative_reductions_out_of_ssa): Call gsi_commit_edge_inserts,
+       and check the SSA representation.
+
+       * gfortran.dg/graphite/id-18.f90: New, reduced from PR41193.
+
+2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
+
        * gcc.dg/graphite/pr40157.c: Use -floop-block as reported in the PR.
 
 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
        * gcc.dg/graphite/pr40157.c: Use -floop-block as reported in the PR.
 
 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
index 014557f..507ab24 100644 (file)
@@ -2591,13 +2591,10 @@ insert_copyin (tree red, gimple loop_phi)
 {
   gimple_seq stmts;
   tree init = initial_value_for_loop_phi (loop_phi);
 {
   gimple_seq stmts;
   tree init = initial_value_for_loop_phi (loop_phi);
-  edge e = edge_initial_value_for_loop_phi (loop_phi);
-  basic_block bb = e->src;
-  gimple_stmt_iterator insert_gsi = gsi_last_bb (bb);
   tree expr = build2 (MODIFY_EXPR, TREE_TYPE (init), red, init);
 
   force_gimple_operand (expr, &stmts, true, NULL);
   tree expr = build2 (MODIFY_EXPR, TREE_TYPE (init), red, init);
 
   force_gimple_operand (expr, &stmts, true, NULL);
-  gsi_insert_seq_before (&insert_gsi, stmts, GSI_SAME_STMT);
+  gsi_insert_seq_on_edge (edge_initial_value_for_loop_phi (loop_phi), stmts);
 }
 
 /* Rewrite out of SSA the reduction described by the loop phi nodes
 }
 
 /* Rewrite out of SSA the reduction described by the loop phi nodes
@@ -2697,6 +2694,13 @@ rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
   FOR_EACH_LOOP (li, loop, 0)
     if (loop_in_sese_p (loop, region))
       rewrite_commutative_reductions_out_of_ssa_loop (loop, reductions);
   FOR_EACH_LOOP (li, loop, 0)
     if (loop_in_sese_p (loop, region))
       rewrite_commutative_reductions_out_of_ssa_loop (loop, reductions);
+
+  gsi_commit_edge_inserts ();
+  update_ssa (TODO_update_ssa);
+#ifdef ENABLE_CHECKING
+  verify_ssa (false);
+  verify_loop_closed_ssa ();
+#endif
 }
 
 /* Builds the polyhedral representation for a SESE region.  */
 }
 
 /* Builds the polyhedral representation for a SESE region.  */