diff options
author | Aditya Kumar <aditya.k7@samsung.com> | 2016-01-21 02:13:14 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2016-01-21 02:13:14 +0000 |
commit | 5431c9ea56229569343aa9ddc6b176916b41f248 (patch) | |
tree | 234fcd82f7d5202fe9ee93e08fcfad10ffa19491 /gcc/graphite-scop-detection.c | |
parent | d7eff5b2843c5113220b825704600408558f4236 (diff) | |
download | gcc-5431c9ea56229569343aa9ddc6b176916b41f248.zip gcc-5431c9ea56229569343aa9ddc6b176916b41f248.tar.gz gcc-5431c9ea56229569343aa9ddc6b176916b41f248.tar.bz2 |
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 <s.pop@samsung.com>
From-SVN: r232654
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r-- | gcc/graphite-scop-detection.c | 29 |
1 files changed, 26 insertions, 3 deletions
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<scop_p> *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); |