]> gcc.gnu.org Git - gcc.git/commitdiff
Remove uses of loop->single_iv.
authorSebastian Pop <sebastian.pop@amd.com>
Wed, 11 Aug 2010 20:27:43 +0000 (20:27 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Wed, 11 Aug 2010 20:27:43 +0000 (20:27 +0000)
2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>

* cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
* cfgloop.h (struct loop): Remove single_iv field.
* graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
(scop_canonicalize_loops): Removed.
(scop_ivs_can_be_represented): Do not use loop->single_iv.  Iterate
over all the loop phi nodes in loop->header.
(build_poly_scop): Remove use of scop_canonicalize_loops.

From-SVN: r163142

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

index e37027ff1aea6f9fd8f7c43bd943910e6d7e1dde..08bb970544169259627d0f15cf015dc4d9c3e9be 100644 (file)
@@ -1,3 +1,13 @@
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
+       * cfgloop.h (struct loop): Remove single_iv field.
+       * graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
+       (scop_canonicalize_loops): Removed.
+       (scop_ivs_can_be_represented): Do not use loop->single_iv.  Iterate
+       over all the loop phi nodes in loop->header.
+       (build_poly_scop): Remove use of scop_canonicalize_loops.
+
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
        * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
index e26a1b30d2cfef7eed0376213087e7c54ed656c3..07b48a37fb32999c0cc38520def23db51606fddf 100644 (file)
@@ -1,3 +1,13 @@
+2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
+       * cfgloop.h (struct loop): Remove single_iv field.
+       * graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
+       (scop_canonicalize_loops): Removed.
+       (scop_ivs_can_be_represented): Do not use loop->single_iv.  Iterate
+       over all the loop phi nodes in loop->header.
+       (build_poly_scop): Remove use of scop_canonicalize_loops.
+
 2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>
 
        * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
index 370c68d63fe9dd01cade6c6280239f3cda8b4e78..24f0ebc792e32d775fde0eb27785b5a3b0b7e157 100644 (file)
@@ -339,7 +339,6 @@ alloc_loop (void)
   loop->exits = ggc_alloc_cleared_loop_exit ();
   loop->exits->next = loop->exits->prev = loop->exits;
   loop->can_be_parallel = false;
-  loop->single_iv = NULL_TREE;
 
   return loop;
 }
index 535e256050d6ffdb93fba6ffcbaf4d05f49fe5fe..1f0e3ca34266ac737929de48fb9f97534c6d1f52 100644 (file)
@@ -165,10 +165,6 @@ struct GTY ((chain_next ("%h.next"))) loop {
 
   /* Head of the cyclic list of the exits of the loop.  */
   struct loop_exit *exits;
-
-  /* The single induction variable of the loop when the loop is in
-     normal form.  */
-  tree single_iv;
 };
 
 /* Flags for state of loop structure.  */
index 7c47a804e86b8de8fbc5e49fc4988cc8cc8556bc..5a8db3dbf80dfcc980d168e25b91ede6b28a5bd9 100644 (file)
@@ -2906,45 +2906,6 @@ rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
 #endif
 }
 
-/* A LOOP is in normal form for Graphite when it contains only one
-   scalar phi node that defines the main induction variable of the
-   loop, only one increment of the IV, and only one exit condition.  */
-
-static void
-graphite_loop_normal_form (loop_p loop)
-{
-  struct tree_niter_desc niter;
-  tree nit;
-  gimple_seq stmts;
-  edge exit = single_dom_exit (loop);
-
-  bool known_niter = number_of_iterations_exit (loop, exit, &niter, false);
-
-  /* At this point we should know the number of iterations.  */
-  gcc_assert (known_niter);
-
-  nit = force_gimple_operand (unshare_expr (niter.niter), &stmts, true,
-                             NULL_TREE);
-  if (stmts)
-    gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
-
-  loop->single_iv = canonicalize_loop_ivs (loop, &nit, false);
-}
-
-/* Rewrite all the loops of SCOP in normal form: one induction
-   variable per loop.  */
-
-static void
-scop_canonicalize_loops (scop_p scop)
-{
-  loop_iterator li;
-  loop_p loop;
-
-  FOR_EACH_LOOP (li, loop, 0)
-    if (loop_in_sese_p (loop, SCOP_REGION (scop)))
-      graphite_loop_normal_form (loop);
-}
-
 /* Java does not initialize long_long_integer_type_node.  */
 #define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
 
@@ -2957,24 +2918,24 @@ scop_ivs_can_be_represented (scop_p scop)
 {
   loop_iterator li;
   loop_p loop;
+  gimple_stmt_iterator psi;
 
   FOR_EACH_LOOP (li, loop, 0)
     {
-      tree type;
-      int precision;
-
       if (!loop_in_sese_p (loop, SCOP_REGION (scop)))
        continue;
 
-      if (!loop->single_iv)
-       continue;
-
-      type = TREE_TYPE (loop->single_iv);
-      precision = TYPE_PRECISION (type);
+      for (psi = gsi_start_phis (loop->header);
+          !gsi_end_p (psi); gsi_next (&psi))
+       {
+         gimple phi = gsi_stmt (psi);
+         tree res = PHI_RESULT (phi);
+         tree type = TREE_TYPE (res);
 
-      if (TYPE_UNSIGNED (type)
-         && precision >= TYPE_PRECISION (my_long_long))
-       return false;
+         if (TYPE_UNSIGNED (type)
+             && TYPE_PRECISION (type) >= TYPE_PRECISION (my_long_long))
+           return false;
+       }
     }
 
   return true;
@@ -2998,7 +2959,6 @@ build_poly_scop (scop_p scop)
   if (nb_pbbs_in_loops (scop) == 0)
     return;
 
-  scop_canonicalize_loops (scop);
   if (!scop_ivs_can_be_represented (scop))
     return;
 
This page took 0.100986 seconds and 5 git commands to generate.