From efa213905e57c906775d51db13e1479f4a277184 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Wed, 1 Dec 2010 17:25:10 +0000 Subject: Postpone the rewrite out of SSA to the end of the translation to polyhedral representation. 2010-11-22 Sebastian Pop 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 --- gcc/graphite-poly.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gcc/graphite-poly.h') diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h index 4a2f25c..8be905e 100644 --- a/gcc/graphite-poly.h +++ b/gcc/graphite-poly.h @@ -389,7 +389,7 @@ struct poly_bb #define PBB_PDR_DUPLICATES_REMOVED(PBB) (PBB->pdr_duplicates_removed) #define PBB_IS_REDUCTION(PBB) (PBB->is_reduction) -extern void new_poly_bb (scop_p, void *, bool); +extern poly_bb_p new_poly_bb (scop_p, void *); extern void free_poly_bb (poly_bb_p); extern void debug_loop_vec (poly_bb_p); extern void schedule_to_scattering (poly_bb_p, int); @@ -434,6 +434,22 @@ number_of_write_pdrs (poly_bb_p pbb) return res; } +/* Returns a gimple_bb from BB. */ + +static inline gimple_bb_p +gbb_from_bb (basic_block bb) +{ + return (gimple_bb_p) bb->aux; +} + +/* The poly_bb of the BB. */ + +static inline poly_bb_p +pbb_from_bb (basic_block bb) +{ + return GBB_PBB (gbb_from_bb (bb)); +} + /* The basic block of the PBB. */ static inline basic_block -- cgit v1.1