Update copyright years in gcc/
[gcc.git] / gcc / graphite-sese-to-poly.c
index 620d09b8544bb84c645878b295fd685e4682f47a..d4a1bb2df9a5f34de23a498b451a37a52f84fb9f 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion of SESE regions to Polyhedra.
-   Copyright (C) 2009-2013 Free Software Foundation, Inc.
+   Copyright (C) 2009-2014 Free Software Foundation, Inc.
    Contributed by Sebastian Pop <sebastian.pop@amd.com>.
 
 This file is part of GCC.
@@ -34,6 +34,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-expr.h"
+#include "is-a.h"
 #include "gimple.h"
 #include "gimple-iterator.h"
 #include "gimplify.h"
@@ -418,7 +423,7 @@ build_scop_bbs_1 (scop_p scop, sbitmap visited, basic_block bb)
 static void
 build_scop_bbs (scop_p scop)
 {
-  sbitmap visited = sbitmap_alloc (last_basic_block);
+  sbitmap visited = sbitmap_alloc (last_basic_block_for_fn (cfun));
   sese region = SCOP_REGION (scop);
 
   bitmap_clear (visited);
@@ -1240,7 +1245,7 @@ public:
   virtual void after_dom_children (basic_block);
 
 private:
-  stack_vec<gimple, 3> m_conditions, m_cases;
+  auto_vec<gimple, 3> m_conditions, m_cases;
   sese m_region;
 };
 
@@ -1885,7 +1890,7 @@ build_scop_drs (scop_p scop)
   int i, j;
   poly_bb_p pbb;
   data_reference_p dr;
-  stack_vec<data_reference_p, 3> drs;
+  auto_vec<data_reference_p, 3> drs;
 
   /* Remove all the PBBs that do not have data references: these basic
      blocks are not handled in the polyhedral representation.  */
@@ -1983,7 +1988,7 @@ insert_stmts (scop_p scop, gimple stmt, gimple_seq stmts,
              gimple_stmt_iterator insert_gsi)
 {
   gimple_stmt_iterator gsi;
-  stack_vec<gimple, 3> x;
+  auto_vec<gimple, 3> x;
 
   gimple_seq_add_stmt (&stmts, stmt);
   for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -2002,7 +2007,7 @@ insert_out_of_ssa_copy (scop_p scop, tree res, tree expr, gimple after_stmt)
   gimple_stmt_iterator gsi;
   tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE);
   gimple stmt = gimple_build_assign (unshare_expr (res), var);
-  stack_vec<gimple, 3> x;
+  auto_vec<gimple, 3> x;
 
   gimple_seq_add_stmt (&stmts, stmt);
   for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -2057,7 +2062,7 @@ insert_out_of_ssa_copy_on_edge (scop_p scop, edge e, tree res, tree expr)
   tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE);
   gimple stmt = gimple_build_assign (unshare_expr (res), var);
   basic_block bb;
-  stack_vec<gimple, 3> x;
+  auto_vec<gimple, 3> x;
 
   gimple_seq_add_stmt (&stmts, stmt);
   for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -2290,7 +2295,7 @@ rewrite_reductions_out_of_ssa (scop_p scop)
   gimple_stmt_iterator psi;
   sese region = SCOP_REGION (scop);
 
-  FOR_EACH_BB (bb)
+  FOR_EACH_BB_FN (bb, cfun)
     if (bb_in_sese_p (bb, region))
       for (psi = gsi_start_phis (bb); !gsi_end_p (psi);)
        {
@@ -2484,7 +2489,7 @@ rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p scop)
   /* Create an extra empty BB after the scop.  */
   split_edge (SESE_EXIT (region));
 
-  FOR_EACH_BB (bb)
+  FOR_EACH_BB_FN (bb, cfun)
     if (bb_in_sese_p (bb, region))
       for (psi = gsi_start_bb (bb); !gsi_end_p (psi); gsi_next (&psi))
        changed |= rewrite_cross_bb_scalar_deps (scop, &psi);
@@ -2865,7 +2870,7 @@ remove_phi (gimple phi)
   tree def;
   use_operand_p use_p;
   gimple_stmt_iterator gsi;
-  stack_vec<gimple, 3> update;
+  auto_vec<gimple, 3> update;
   unsigned int i;
   gimple stmt;
 
@@ -3023,8 +3028,8 @@ rewrite_commutative_reductions_out_of_ssa_close_phi (scop_p scop,
                                                     gimple close_phi)
 {
   bool res;
-  stack_vec<gimple, 10> in;
-  stack_vec<gimple, 10> out;
+  auto_vec<gimple, 10> in;
+  auto_vec<gimple, 10> out;
 
   detect_commutative_reduction (scop, close_phi, &in, &out);
   res = in.length () > 1;
@@ -3064,12 +3069,11 @@ rewrite_commutative_reductions_out_of_ssa_loop (scop_p scop,
 static void
 rewrite_commutative_reductions_out_of_ssa (scop_p scop)
 {
-  loop_iterator li;
   loop_p loop;
   bool changed = false;
   sese region = SCOP_REGION (scop);
 
-  FOR_EACH_LOOP (li, loop, 0)
+  FOR_EACH_LOOP (loop, 0)
     if (loop_in_sese_p (loop, region))
       changed |= rewrite_commutative_reductions_out_of_ssa_loop (scop, loop);
 
@@ -3091,12 +3095,11 @@ rewrite_commutative_reductions_out_of_ssa (scop_p scop)
 static bool
 scop_ivs_can_be_represented (scop_p scop)
 {
-  loop_iterator li;
   loop_p loop;
   gimple_stmt_iterator psi;
   bool result = true;
 
-  FOR_EACH_LOOP (li, loop, 0)
+  FOR_EACH_LOOP (loop, 0)
     {
       if (!loop_in_sese_p (loop, SCOP_REGION (scop)))
        continue;
@@ -3116,7 +3119,7 @@ scop_ivs_can_be_represented (scop_p scop)
            }
        }
       if (!result)
-       FOR_EACH_LOOP_BREAK (li);
+       break;
     }
 
   return result;