graphite-scop-detection.c (find_scop_parameters): Move loop bound handling ...

2017-09-27  Richard Biener  <rguenther@suse.de>

	* 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
This commit is contained in:
Richard Biener 2017-09-27 14:35:04 +00:00 committed by Richard Biener
parent 509b9b7ae0
commit 6f0e6f0868
4 changed files with 27 additions and 41 deletions

View File

@ -1,3 +1,14 @@
2017-09-27 Richard Biener <rguenther@suse.de>
* 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 <jakub@redhat.com>
PR c++/82159

View File

@ -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);

View File

@ -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)

View File

@ -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_p> loop_nest;
/* Basic blocks contained in this SESE. */
vec<basic_block> bbs;