From 5431c9ea56229569343aa9ddc6b176916b41f248 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 21 Jan 2016 02:13:14 +0000 Subject: record loops in execution order * graphite-scop-detection.c (record_loop_in_sese): New. (gather_bbs::before_dom_children): Call record_loop_in_sese. (build_scops): Remove call to build_sese_loop_nests. * sese.c (sese_record_loop): Remove. (build_sese_loop_nests): Remove. (new_sese_info): Remove region->loops. (free_sese_info): Same. * sese.h (sese_contains_loop): Same. (build_sese_loop_nests): Remove. (sese_contains_loop): Remove. Co-Authored-By: Sebastian Pop From-SVN: r232654 --- gcc/graphite-scop-detection.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'gcc/graphite-scop-detection.c') diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index cd376d1..68b9f4d 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1874,15 +1874,40 @@ gather_bbs::gather_bbs (cdi_direction direction, scop_p scop) { } +/* 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. */ edge gather_bbs::before_dom_children (basic_block bb) { - if (!bb_in_sese_p (bb, scop->scop_info->region)) + sese_info_p region = scop->scop_info; + if (!bb_in_sese_p (bb, region->region)) return NULL; + record_loop_in_sese (bb, region); + gcond *stmt = single_pred_cond_non_loop_exit (bb); if (stmt) @@ -1991,8 +2016,6 @@ build_scops (vec *scops) continue; } - build_sese_loop_nests (scop->scop_info); - find_scop_parameters (scop); graphite_dim_t max_dim = PARAM_VALUE (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS); -- cgit v1.1