Commit 1cb28772 by Aditya Kumar Committed by Sebastian Pop

Use const-ref instead of values for sese_l passed to functions.

gcc/ChangeLog:

2015-12-24  hiraditya  <hiraditya@msn.com>

        * 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
parent 402cab17
2015-12-24 Aditya Kumar <aditya.k7@samsung.com> 2015-12-24 Aditya Kumar <aditya.k7@samsung.com>
* 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 <aditya.k7@samsung.com>
* graphite-scop-detection.c * graphite-scop-detection.c
(scop_detection::get_nearest_dom_with_single_entry): Check l == l2. (scop_detection::get_nearest_dom_with_single_entry): Check l == l2.
(scop_detection::get_nearest_pdom_with_single_exit): Same. (scop_detection::get_nearest_pdom_with_single_exit): Same.
...@@ -465,7 +465,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop, ...@@ -465,7 +465,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
{ {
tree nb_iters = number_of_latch_executions (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)); gcc_assert (loop_in_sese_p (loop, region));
isl_set *inner = isl_set_copy (outer); isl_set *inner = isl_set_copy (outer);
......
...@@ -523,7 +523,7 @@ set_ifsese_condition (ifsese if_region, tree condition) ...@@ -523,7 +523,7 @@ set_ifsese_condition (ifsese if_region, tree condition)
when T depends on memory that may change in REGION. */ when T depends on memory that may change in REGION. */
bool bool
invariant_in_sese_p_rec (tree t, sese_l &region, bool *has_vdefs) invariant_in_sese_p_rec (tree t, const sese_l &region, bool *has_vdefs)
{ {
if (!defined_in_sese_p (t, region)) if (!defined_in_sese_p (t, region))
return true; return true;
...@@ -596,7 +596,7 @@ scev_analyzable_p (tree def, sese_l &region) ...@@ -596,7 +596,7 @@ scev_analyzable_p (tree def, sese_l &region)
is not defined in the REGION is considered a parameter. */ is not defined in the REGION is considered a parameter. */
tree tree
scalar_evolution_in_region (sese_l &region, loop_p loop, tree t) scalar_evolution_in_region (const sese_l &region, loop_p loop, tree t)
{ {
gimple *def; gimple *def;
struct loop *def_loop; struct loop *def_loop;
......
...@@ -109,9 +109,9 @@ extern void free_sese_info (sese_info_p); ...@@ -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 sese_insert_phis_for_liveouts (sese_info_p, basic_block, edge, edge);
extern void build_sese_loop_nests (sese_info_p); extern void build_sese_loop_nests (sese_info_p);
extern struct loop *outermost_loop_in_sese (sese_l &, basic_block); 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 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. */ /* Check that SESE contains LOOP. */
...@@ -133,7 +133,7 @@ sese_nb_params (sese_info_p region) ...@@ -133,7 +133,7 @@ sese_nb_params (sese_info_p region)
EXIT blocks. */ EXIT blocks. */
static inline bool 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. */ /* FIXME: PR67842. */
#if 0 #if 0
...@@ -158,7 +158,7 @@ bb_in_region (basic_block bb, basic_block entry, basic_block exit) ...@@ -158,7 +158,7 @@ bb_in_region (basic_block bb, basic_block entry, basic_block exit)
EXIT blocks. */ EXIT blocks. */
static inline bool 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); 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) ...@@ -166,7 +166,7 @@ bb_in_sese_p (basic_block bb, sese_l &r)
/* Returns true when STMT is defined in REGION. */ /* Returns true when STMT is defined in REGION. */
static inline bool 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); basic_block bb = gimple_bb (stmt);
return bb && bb_in_sese_p (bb, r); return bb && bb_in_sese_p (bb, r);
...@@ -175,7 +175,7 @@ stmt_in_sese_p (gimple *stmt, sese_l &r) ...@@ -175,7 +175,7 @@ stmt_in_sese_p (gimple *stmt, sese_l &r)
/* Returns true when NAME is defined in REGION. */ /* Returns true when NAME is defined in REGION. */
static inline bool 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); return stmt_in_sese_p (SSA_NAME_DEF_STMT (name), r);
} }
...@@ -183,7 +183,7 @@ defined_in_sese_p (tree name, sese_l &r) ...@@ -183,7 +183,7 @@ defined_in_sese_p (tree name, sese_l &r)
/* Returns true when LOOP is in REGION. */ /* Returns true when LOOP is in REGION. */
static inline bool static inline bool
loop_in_sese_p (struct loop *loop, sese_l &region) loop_in_sese_p (struct loop *loop, const sese_l &region)
{ {
return (bb_in_sese_p (loop->header, region) return (bb_in_sese_p (loop->header, region)
&& bb_in_sese_p (loop->latch, region)); && bb_in_sese_p (loop->latch, region));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment