aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-12-01 17:25:10 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-12-01 17:25:10 +0000
commitefa213905e57c906775d51db13e1479f4a277184 (patch)
tree31b829048b2061334b2835044bc650e65ff4bcb6 /gcc/graphite.c
parent70a2ae0f4570a91c23b554761dc105c899fce4bb (diff)
downloadgcc-efa213905e57c906775d51db13e1479f4a277184.zip
gcc-efa213905e57c906775d51db13e1479f4a277184.tar.gz
gcc-efa213905e57c906775d51db13e1479f4a277184.tar.bz2
Postpone the rewrite out of SSA to the end of the translation to polyhedral representation.
2010-11-22 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/45297 * graphite-poly.c (new_poly_bb): Returns a poly_bb_p. Do not take the reduction bool in parameter. Clear PBB_IS_REDUCTION. Set GBB_PBB. * graphite-poly.h (new_poly_bb): Update declaration. (gbb_from_bb): Moved here... (pbb_from_bb): New. * graphite-sese-to-poly.c (var_used_in_not_loop_header_phi_node): Removed. (graphite_stmt_p): Removed. (try_generate_gimple_bb): Returns a gimple_bb_p. Do not pass in sbitmap reductions. Always build a gimple_bb_p. Do not call new_poly_bb. (build_scop_bbs_1): Do not pass in sbitmap reductions. (build_scop_bbs): Same. (gbb_from_bb): ... from here. (add_conditions_to_constraints): Moved up. (analyze_drs): New. (build_scop_drs): Call analyze_drs. Remove all the PBBs that do not contain data references. (new_pbb_from_pbb): New. (insert_out_of_ssa_copy_on_edge): Call new_pbb_from_pbb after a block is split. (rewrite_close_phi_out_of_ssa): Update call to insert_out_of_ssa_copy_on_edge. (rewrite_reductions_out_of_ssa): Now static. (rewrite_cross_bb_scalar_deps_out_of_ssa): Same. (split_pbb): New. (split_reduction_stmt): Call split_pbb. (translate_scalar_reduction_to_array): Pass in the scop, do not pass in the sbitmap reductions. (rewrite_commutative_reductions_out_of_ssa_close_phi): Same. (rewrite_commutative_reductions_out_of_ssa_loop): Same. (rewrite_commutative_reductions_out_of_ssa): Same. (build_poly_scop): Call build_scop_bbs, rewrite_commutative_reductions_out_of_ssa, rewrite_reductions_out_of_ssa, and rewrite_cross_bb_scalar_deps_out_of_ssa. Move build_scop_drs before scop_to_lst. * graphite-sese-to-poly.h (rewrite_commutative_reductions_out_of_ssa): Removed declaration. (rewrite_reductions_out_of_ssa): Same. (rewrite_cross_bb_scalar_deps_out_of_ssa): Same. (build_scop_bbs): Same. * graphite.c (graphite_transform_loops): Do not initialize reductions. Do not call build_scop_bbs, rewrite_commutative_reductions_out_of_ssa, rewrite_reductions_out_of_ssa, and rewrite_cross_bb_scalar_deps_out_of_ssa. * sese.h (struct gimple_bb): Add field pbb. (GBB_PBB): New. * gcc.dg/graphite/pr45297.c: New. From-SVN: r167348
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r--gcc/graphite.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 74b671d..4ce484a 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -262,7 +262,6 @@ 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;
@@ -276,33 +275,17 @@ 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_EACH_VEC_ELT (scop_p, scops, i, scop)
- if (dbg_cnt (graphite_scop))
- rewrite_commutative_reductions_out_of_ssa (SCOP_REGION (scop),
- reductions);
FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (dbg_cnt (graphite_scop))
{
- rewrite_reductions_out_of_ssa (scop);
- rewrite_cross_bb_scalar_deps_out_of_ssa (scop);
- build_scop_bbs (scop, reductions);
- }
-
- sbitmap_free (reductions);
+ build_poly_scop (scop);
- FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
- if (dbg_cnt (graphite_scop))
- build_poly_scop (scop);
-
- FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
- if (POLY_SCOP_P (scop)
- && apply_poly_transforms (scop)
- && gloog (scop, bb_pbb_mapping))
- need_cfg_cleanup_p = true;
+ if (POLY_SCOP_P (scop)
+ && apply_poly_transforms (scop)
+ && gloog (scop, bb_pbb_mapping))
+ need_cfg_cleanup_p = true;
+ }
htab_delete (bb_pbb_mapping);
free_scops (scops);