/* 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.
#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"
#include "tree-ssa-propagate.h"
#ifdef HAVE_cloog
+#include "expr.h"
#include "graphite-poly.h"
#include "graphite-sese-to-poly.h"
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);
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;
};
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. */
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))
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))
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))
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);)
{
/* 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);
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;
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;
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);
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;
}
}
if (!result)
- FOR_EACH_LOOP_BREAK (li);
+ break;
}
return result;