summaryrefslogtreecommitdiff
path: root/gcc/graphite.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-08-11 20:24:16 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-08-11 20:24:16 +0000
commit3a7086cc51984f7b1f5b0d709500382eb16875e2 (patch)
treed0cb67f308415d8102e0a5fbb919071f3a5e86cd /gcc/graphite.c
parent61ca46ce9b4343929106dae5f06f65362663dac7 (diff)
downloadgcc-3a7086cc51984f7b1f5b0d709500382eb16875e2.tar.gz
Detect commutative reductions in all the scops before rewriting out of SSA all the other scalar dependences.
2010-06-12 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (build_scop_bbs): Not static anymore. (rewrite_reductions_out_of_ssa): Same. (rewrite_commutative_reductions_out_of_ssa): Same. (build_poly_scop): Do not call these functions. * graphite-sese-to-poly.h (build_poly_scop): Declared. (rewrite_reductions_out_of_ssa): Declared. (rewrite_commutative_reductions_out_of_ssa): Declared. * graphite.c (graphite_transform_loops): Call on every scop rewrite_commutative_reductions_out_of_ssa before calling rewrite_reductions_out_of_ssa and build_scop_bbs. From-SVN: r163116
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r--gcc/graphite.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 2933d21571c..bd47cf7039d 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -253,6 +253,7 @@ graphite_transform_loops (void)
bool need_cfg_cleanup_p = false;
VEC (scop_p, heap) *scops = NULL;
htab_t bb_pbb_mapping;
+ sbitmap reductions;
if (!graphite_initialize ())
return;
@@ -266,6 +267,19 @@ graphite_transform_loops (void)
}
bb_pbb_mapping = htab_create (10, bb_pbb_map_hash, eq_bb_pbb_map, free);
+ reductions = sbitmap_alloc (last_basic_block * 2);
+ sbitmap_zero (reductions);
+
+ for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ rewrite_commutative_reductions_out_of_ssa (SCOP_REGION (scop), reductions);
+
+ for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ {
+ rewrite_reductions_out_of_ssa (scop);
+ build_scop_bbs (scop, reductions);
+ }
+
+ sbitmap_free (reductions);
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
build_poly_scop (scop);