From 1cb287721a2d556baf84dd9850870ef317edc1a9 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 24 Dec 2015 16:41:57 +0000 Subject: [PATCH] Use const-ref instead of values for sese_l passed to functions. gcc/ChangeLog: 2015-12-24 hiraditya * graphite-sese-to-poly.c (build_loop_iteration_domains): Use ref instead of value. * sese.c (invariant_in_sese_p_rec): Use const ref instead of value. (scalar_evolution_in_region): Same * sese.h (bb_in_region): Same (bb_in_sese_p): Same. (stmt_in_sese_p): Same. (defined_in_sese_p): Same. (loop_in_sese_p): Same. From-SVN: r231947 --- gcc/ChangeLog | 11 +++++++++++ gcc/graphite-sese-to-poly.c | 2 +- gcc/sese.c | 4 ++-- gcc/sese.h | 14 +++++++------- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a1032d8ffd..dfd46d99282 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2015-12-24 Aditya Kumar + + * graphite-sese-to-poly.c (build_loop_iteration_domains): Use ref instead of value. + * sese.c (invariant_in_sese_p_rec): Use const ref instead of value. + (scalar_evolution_in_region): Same + * sese.h (bb_in_region): Same + (bb_in_sese_p): Same. + (stmt_in_sese_p): Same. + (defined_in_sese_p): Same. + (loop_in_sese_p): Same. + 2015-12-24 Aditya Kumar * graphite-scop-detection.c diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 7992c284862..a7fd5d9b918 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -465,7 +465,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop, { tree nb_iters = number_of_latch_executions (loop); - sese_l region = scop->scop_info->region; + const sese_l& region = scop->scop_info->region; gcc_assert (loop_in_sese_p (loop, region)); isl_set *inner = isl_set_copy (outer); diff --git a/gcc/sese.c b/gcc/sese.c index 74dc4ac7b86..b0f54dea1ae 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -523,7 +523,7 @@ set_ifsese_condition (ifsese if_region, tree condition) when T depends on memory that may change in REGION. */ bool -invariant_in_sese_p_rec (tree t, sese_l ®ion, bool *has_vdefs) +invariant_in_sese_p_rec (tree t, const sese_l ®ion, bool *has_vdefs) { if (!defined_in_sese_p (t, region)) return true; @@ -596,7 +596,7 @@ scev_analyzable_p (tree def, sese_l ®ion) is not defined in the REGION is considered a parameter. */ tree -scalar_evolution_in_region (sese_l ®ion, loop_p loop, tree t) +scalar_evolution_in_region (const sese_l ®ion, loop_p loop, tree t) { gimple *def; struct loop *def_loop; diff --git a/gcc/sese.h b/gcc/sese.h index 626a077b1db..99df3542f80 100644 --- a/gcc/sese.h +++ b/gcc/sese.h @@ -109,9 +109,9 @@ extern void free_sese_info (sese_info_p); extern void sese_insert_phis_for_liveouts (sese_info_p, basic_block, edge, edge); extern void build_sese_loop_nests (sese_info_p); extern struct loop *outermost_loop_in_sese (sese_l &, basic_block); -extern tree scalar_evolution_in_region (sese_l &, loop_p, tree); +extern tree scalar_evolution_in_region (const sese_l &, loop_p, tree); extern bool scev_analyzable_p (tree, sese_l &); -extern bool invariant_in_sese_p_rec (tree, sese_l &, bool *); +extern bool invariant_in_sese_p_rec (tree, const sese_l &, bool *); /* Check that SESE contains LOOP. */ @@ -133,7 +133,7 @@ sese_nb_params (sese_info_p region) EXIT blocks. */ static inline bool -bb_in_region (basic_block bb, basic_block entry, basic_block exit) +bb_in_region (const_basic_block bb, const_basic_block entry, const_basic_block exit) { /* FIXME: PR67842. */ #if 0 @@ -158,7 +158,7 @@ bb_in_region (basic_block bb, basic_block entry, basic_block exit) EXIT blocks. */ static inline bool -bb_in_sese_p (basic_block bb, sese_l &r) +bb_in_sese_p (basic_block bb, const sese_l &r) { return bb_in_region (bb, r.entry->dest, r.exit->dest); } @@ -166,7 +166,7 @@ bb_in_sese_p (basic_block bb, sese_l &r) /* Returns true when STMT is defined in REGION. */ static inline bool -stmt_in_sese_p (gimple *stmt, sese_l &r) +stmt_in_sese_p (gimple *stmt, const sese_l &r) { basic_block bb = gimple_bb (stmt); return bb && bb_in_sese_p (bb, r); @@ -175,7 +175,7 @@ stmt_in_sese_p (gimple *stmt, sese_l &r) /* Returns true when NAME is defined in REGION. */ static inline bool -defined_in_sese_p (tree name, sese_l &r) +defined_in_sese_p (tree name, const sese_l &r) { return stmt_in_sese_p (SSA_NAME_DEF_STMT (name), r); } @@ -183,7 +183,7 @@ defined_in_sese_p (tree name, sese_l &r) /* Returns true when LOOP is in REGION. */ static inline bool -loop_in_sese_p (struct loop *loop, sese_l ®ion) +loop_in_sese_p (struct loop *loop, const sese_l ®ion) { return (bb_in_sese_p (loop->header, region) && bb_in_sese_p (loop->latch, region)); -- 2.30.2