+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
}
}
-/* 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
{
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;
{
}
-/* 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. */
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);
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;
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)