aboutsummaryrefslogtreecommitdiff
path: root/gcc/sese.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-10-17 13:19:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-10-17 13:19:51 +0000
commit92900aec89c94d569a94c4f2e42d90e25f993bb0 (patch)
tree0c41f10e1e0ccec68344f859431ef7ab51907ab3 /gcc/sese.c
parent7ea3a3c75964dfef45eaa771fc914ec15a6aada9 (diff)
downloadgcc-92900aec89c94d569a94c4f2e42d90e25f993bb0.zip
gcc-92900aec89c94d569a94c4f2e42d90e25f993bb0.tar.gz
gcc-92900aec89c94d569a94c4f2e42d90e25f993bb0.tar.bz2
2017-10-17 Richard Biener <rguenther@suse.de>
* graphite-scop-detection.c (scop_detection::stmt_has_simple_data_refs_p): Always use the full nest as region. (try_generate_gimple_bb): Likewise. * sese.c (scalar_evolution_in_region): Simplify now that SCEV can handle instantiation in regions. * tree-scalar-evolution.c (instantiate_scev_name): Also instantiate in the non-loop part of a function if requested. From-SVN: r253811
Diffstat (limited to 'gcc/sese.c')
-rw-r--r--gcc/sese.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/gcc/sese.c b/gcc/sese.c
index 8aa8015..7fcda75a 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -459,41 +459,16 @@ scev_analyzable_p (tree def, sese_l &region)
tree
scalar_evolution_in_region (const sese_l &region, loop_p loop, tree t)
{
- gimple *def;
- struct loop *def_loop;
-
/* SCOP parameters. */
if (TREE_CODE (t) == SSA_NAME
&& !defined_in_sese_p (t, region))
return t;
- if (TREE_CODE (t) != SSA_NAME
- || loop_in_sese_p (loop, region))
- /* FIXME: we would need instantiate SCEV to work on a region, and be more
- flexible wrt. memory loads that may be invariant in the region. */
- return instantiate_scev (region.entry, loop,
- analyze_scalar_evolution (loop, t));
-
- def = SSA_NAME_DEF_STMT (t);
- def_loop = loop_containing_stmt (def);
-
- if (loop_in_sese_p (def_loop, region))
- {
- t = analyze_scalar_evolution (def_loop, t);
- def_loop = superloop_at_depth (def_loop, loop_depth (loop) + 1);
- t = compute_overall_effect_of_inner_loop (def_loop, t);
- return t;
- }
-
- bool has_vdefs = false;
- if (invariant_in_sese_p_rec (t, region, &has_vdefs))
- return t;
-
- /* T variates in REGION. */
- if (has_vdefs)
- return chrec_dont_know;
+ if (!loop_in_sese_p (loop, region))
+ loop = NULL;
- return instantiate_scev (region.entry, loop, t);
+ return instantiate_scev (region.entry, loop,
+ analyze_scalar_evolution (loop, t));
}
/* Return true if BB is empty, contains only DEBUG_INSNs. */