diff options
author | Aditya Kumar <aditya.k7@samsung.com> | 2015-10-07 19:25:35 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2015-10-07 19:25:35 +0000 |
commit | b0b5710cf676de537bc97b912218dd20d2cc36cd (patch) | |
tree | b6c490b95437aad607c9450aa3273e12269a95b6 /gcc/graphite-sese-to-poly.c | |
parent | b759335b16ebc8d6640778df53c18fe11ca7083a (diff) | |
download | gcc-b0b5710cf676de537bc97b912218dd20d2cc36cd.zip gcc-b0b5710cf676de537bc97b912218dd20d2cc36cd.tar.gz gcc-b0b5710cf676de537bc97b912218dd20d2cc36cd.tar.bz2 |
gather bbs and conditions in a single walk through dominators
Clean up the function to build scop's basic blocks and the function
that gathers the conditions under which a basic block is executed. We remove
one traversal of the dominator tree.
This refactoring was triggered by the need of a vec<bb> of all the basic blocks
in a region. We will use that vector in a patch that removes the out-of-ssa
translation of scalar dependences: we will iterate through the basic blocks of a
region to record scalar dependences crossing bbs or going out of the region.
The patch passes bootstrap and regtest on x86_64-linux.
2015-10-06 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
* graphite-dependences.c (scop_get_dependences): Do not use SCOP_BBS.
* graphite-isl-ast-to-gimple.c (get_max_schedule_dimensions): Same.
(generate_isl_schedule): Same.
* graphite-optimize-isl.c (scop_get_domains): Same.
(apply_schedule_map_to_scop): Same.
* graphite-poly.c (print_iteration_domains): Same.
(remove_gbbs_in_scop): Same.
(new_scop): Same.
(free_scop): Same.
(print_scop): Same.
* graphite-poly.h (struct scop): Rename bbs to pbbs.
(SCOP_BBS): Remove.
* graphite-scop-detection.c (compare_bb_depths): Remove.
(graphite_sort_dominated_info): Remove.
(try_generate_gimple_bb): Move out of scop_detection.
(all_non_dominated_preds_marked_p): Remove.
(build_scop_bbs_1): Remove.
(build_scop_bbs): Remove.
(nb_pbbs_in_loops): Do not use SCOP_BBS.
(find_scop_parameters): Same.
(sese_dom_walker): Rename gather_bbs.
(before_dom_children): Call try_generate_gimple_bb and collect gbb
and pbb.
(build_scops): Call gather_bbs.
* graphite-sese-to-poly.c (build_scop_scattering): Do not use SCOP_BBS.
(add_conditions_to_constraints): Same.
(build_scop_iteration_domain): Same.
(build_scop_drs): Same.
(new_pbb_from_pbb): Same.
* sese.c (new_sese_info): Create bbs.
* sese.h (struct sese_info_t): Add bbs.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r228581
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r-- | gcc/graphite-sese-to-poly.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index c9a2964..261e67d 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -329,7 +329,7 @@ build_scop_scattering (scop_p scop) int i; poly_bb_p pbb; - FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb) + FOR_EACH_VEC_ELT (scop->pbbs, i, pbb) { gimple_poly_bb_p gbb = PBB_BLACK_BOX (pbb); int prefix = 0; @@ -808,7 +808,7 @@ add_conditions_to_constraints (scop_p scop) int i; poly_bb_p pbb; - FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb) + FOR_EACH_VEC_ELT (scop->pbbs, i, pbb) add_conditions_to_domain (pbb); } @@ -904,7 +904,7 @@ build_scop_iteration_domain (scop_p scop) isl_set_copy (scop->param_context), doms); poly_bb_p pbb; - FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb) + FOR_EACH_VEC_ELT (scop->pbbs, i, pbb) { loop = pbb_loop (pbb); @@ -1138,17 +1138,17 @@ build_scop_drs (scop_p scop) /* Remove all the PBBs that do not have data references: these basic blocks are not handled in the polyhedral representation. */ - for (i = 0; SCOP_BBS (scop).iterate (i, &pbb); i++) + for (i = 0; scop->pbbs.iterate (i, &pbb); i++) if (GBB_DATA_REFS (PBB_BLACK_BOX (pbb)).is_empty ()) { free_gimple_poly_bb (PBB_BLACK_BOX (pbb)); free_poly_bb (pbb); - SCOP_BBS (scop).ordered_remove (i); + scop->pbbs.ordered_remove (i); i--; } data_reference_p dr; - FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb) + FOR_EACH_VEC_ELT (scop->pbbs, i, pbb) if (pbb) FOR_EACH_VEC_ELT (GBB_DATA_REFS (PBB_BLACK_BOX (pbb)), j, dr) scop->drs.safe_push (dr_info (dr, -1, pbb)); @@ -1248,11 +1248,10 @@ new_pbb_from_pbb (scop_p scop, poly_bb_p pbb, basic_block bb) gimple_poly_bb_p gbb = PBB_BLACK_BOX (pbb); gimple_poly_bb_p gbb1 = new_gimple_poly_bb (bb, drs); poly_bb_p pbb1 = new_poly_bb (scop, gbb1); - int index, n = SCOP_BBS (scop).length (); + int index, n = scop->pbbs.length (); - /* The INDEX of PBB in SCOP_BBS. */ for (index = 0; index < n; index++) - if (SCOP_BBS (scop)[index] == pbb) + if (scop->pbbs[index] == pbb) break; pbb1->domain = isl_set_copy (pbb->domain); @@ -1262,7 +1261,7 @@ new_pbb_from_pbb (scop_p scop, poly_bb_p pbb, basic_block bb) GBB_PBB (gbb1) = pbb1; GBB_CONDITIONS (gbb1) = GBB_CONDITIONS (gbb).copy (); GBB_CONDITION_CASES (gbb1) = GBB_CONDITION_CASES (gbb).copy (); - SCOP_BBS (scop).safe_insert (index + 1, pbb1); + scop->pbbs.safe_insert (index + 1, pbb1); } /* Insert on edge E the assignment "RES := EXPR". */ |