From 6f0e6f0868f02f79a2ee561419393839d974c1f7 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 27 Sep 2017 14:35:04 +0000 Subject: [PATCH] graphite-scop-detection.c (find_scop_parameters): Move loop bound handling ... 2017-09-27 Richard Biener * graphite-scop-detection.c (find_scop_parameters): Move loop bound handling ... (gather_bbs::before_dom_children): ... here, avoiding the need to build scop_info->loop_nest. (record_loop_in_sese): Remove. * sese.h (sese_info_t::loop_nest): Remove. * sese.c (new_sese_info): Do not allocate loop_nest. (free_sese_info): Do not free loop_nest. From-SVN: r253232 --- gcc/ChangeLog | 11 ++++++++ gcc/graphite-scop-detection.c | 52 +++++++++++------------------------ gcc/sese.c | 2 -- gcc/sese.h | 3 -- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44783aab64b..c70af4f60ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2017-09-27 Richard Biener + + * graphite-scop-detection.c (find_scop_parameters): Move + loop bound handling ... + (gather_bbs::before_dom_children): ... here, avoiding the need + to build scop_info->loop_nest. + (record_loop_in_sese): Remove. + * sese.h (sese_info_t::loop_nest): Remove. + * sese.c (new_sese_info): Do not allocate loop_nest. + (free_sese_info): Do not free loop_nest. + 2017-09-27 Jakub Jelinek PR c++/82159 diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 351e944e9c8..b374ee1a4e1 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1324,7 +1324,7 @@ find_params_in_bb (sese_info_p region, gimple_poly_bb_p gbb) } } -/* Record the parameters used in the SCOP. A variable is a parameter +/* Record the parameters used in the SCOP BBs. A variable is a parameter in a scop if it does not vary during the execution of that scop. */ static void @@ -1332,19 +1332,8 @@ find_scop_parameters (scop_p scop) { unsigned i; sese_info_p region = scop->scop_info; - struct loop *loop; - /* Find the parameters used in the loop bounds. */ - FOR_EACH_VEC_ELT (region->loop_nest, i, loop) - { - tree nb_iters = number_of_latch_executions (loop); - - if (!chrec_contains_symbols (nb_iters)) - continue; - - nb_iters = scalar_evolution_in_region (region->region, loop, nb_iters); - scan_tree_for_params (region, nb_iters); - } + /* Parameters used in loop bounds are processed during gather_bbs. */ /* Find the parameters used in data accesses. */ poly_bb_p pbb; @@ -1555,28 +1544,6 @@ gather_bbs::gather_bbs (cdi_direction direction, scop_p scop, int *bb_to_rpo) { } -/* Record in execution order the loops fully contained in the region. */ - -static void -record_loop_in_sese (basic_block bb, sese_info_p region) -{ - loop_p father = bb->loop_father; - if (loop_in_sese_p (father, region->region)) - { - bool found = false; - loop_p loop0; - int j; - FOR_EACH_VEC_ELT (region->loop_nest, j, loop0) - if (father == loop0) - { - found = true; - break; - } - if (!found) - region->loop_nest.safe_push (father); - } -} - /* Call-back for dom_walk executed before visiting the dominated blocks. */ @@ -1587,7 +1554,20 @@ gather_bbs::before_dom_children (basic_block bb) if (!bb_in_sese_p (bb, region->region)) return dom_walker::STOP; - record_loop_in_sese (bb, region); + /* For loops fully contained in the region record parameters in the + loop bounds. */ + loop_p loop = bb->loop_father; + if (loop->header == bb + && loop_in_sese_p (loop, region->region)) + { + tree nb_iters = number_of_latch_executions (loop); + if (chrec_contains_symbols (nb_iters)) + { + nb_iters = scalar_evolution_in_region (region->region, + loop, nb_iters); + scan_tree_for_params (region, nb_iters); + } + } gcond *stmt = single_pred_cond_non_loop_exit (bb); diff --git a/gcc/sese.c b/gcc/sese.c index b4a37f75c09..ad85aa47410 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -179,7 +179,6 @@ new_sese_info (edge entry, edge exit) region->region.entry = entry; region->region.exit = exit; - region->loop_nest.create (3); region->params.create (3); region->rename_map = new rename_map_t; region->parameter_rename_map = new parameter_rename_map_t; @@ -197,7 +196,6 @@ void free_sese_info (sese_info_p region) { region->params.release (); - region->loop_nest.release (); for (rename_map_t::iterator it = region->rename_map->begin (); it != region->rename_map->end (); ++it) diff --git a/gcc/sese.h b/gcc/sese.h index 025e733476c..3bdb34c1a67 100644 --- a/gcc/sese.h +++ b/gcc/sese.h @@ -94,9 +94,6 @@ typedef struct sese_info_t /* Parameters to be renamed. */ parameter_rename_map_t *parameter_rename_map; - /* Loops completely contained in this SESE. */ - vec loop_nest; - /* Basic blocks contained in this SESE. */ vec bbs; -- 2.30.2