mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
7ea3a3c759
commit
92900aec89
|
|
@ -1,3 +1,14 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2017-10-17 Richard Biener <rguenther@suse.de>
|
2017-10-17 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
PR tree-optimization/82563
|
PR tree-optimization/82563
|
||||||
|
|
|
||||||
|
|
@ -1005,15 +1005,10 @@ scop_detection::graphite_can_represent_expr (sese_l scop, loop_p loop,
|
||||||
bool
|
bool
|
||||||
scop_detection::stmt_has_simple_data_refs_p (sese_l scop, gimple *stmt)
|
scop_detection::stmt_has_simple_data_refs_p (sese_l scop, gimple *stmt)
|
||||||
{
|
{
|
||||||
edge nest;
|
edge nest = scop.entry;;
|
||||||
loop_p loop = loop_containing_stmt (stmt);
|
loop_p loop = loop_containing_stmt (stmt);
|
||||||
if (!loop_in_sese_p (loop, scop))
|
if (!loop_in_sese_p (loop, scop))
|
||||||
{
|
loop = NULL;
|
||||||
nest = scop.entry;
|
|
||||||
loop = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
nest = loop_preheader_edge (outermost_loop_in_sese (scop, gimple_bb (stmt)));
|
|
||||||
|
|
||||||
auto_vec<data_reference_p> drs;
|
auto_vec<data_reference_p> drs;
|
||||||
if (! graphite_find_data_references_in_stmt (nest, loop, stmt, &drs))
|
if (! graphite_find_data_references_in_stmt (nest, loop, stmt, &drs))
|
||||||
|
|
@ -1381,15 +1376,10 @@ try_generate_gimple_bb (scop_p scop, basic_block bb)
|
||||||
vec<scalar_use> reads = vNULL;
|
vec<scalar_use> reads = vNULL;
|
||||||
|
|
||||||
sese_l region = scop->scop_info->region;
|
sese_l region = scop->scop_info->region;
|
||||||
edge nest;
|
edge nest = region.entry;
|
||||||
loop_p loop = bb->loop_father;
|
loop_p loop = bb->loop_father;
|
||||||
if (!loop_in_sese_p (loop, region))
|
if (!loop_in_sese_p (loop, region))
|
||||||
{
|
loop = NULL;
|
||||||
nest = region.entry;
|
|
||||||
loop = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
nest = loop_preheader_edge (outermost_loop_in_sese (region, bb));
|
|
||||||
|
|
||||||
for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
|
for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
|
||||||
gsi_next (&gsi))
|
gsi_next (&gsi))
|
||||||
|
|
|
||||||
33
gcc/sese.c
33
gcc/sese.c
|
|
@ -459,41 +459,16 @@ scev_analyzable_p (tree def, sese_l ®ion)
|
||||||
tree
|
tree
|
||||||
scalar_evolution_in_region (const 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;
|
|
||||||
|
|
||||||
/* SCOP parameters. */
|
/* SCOP parameters. */
|
||||||
if (TREE_CODE (t) == SSA_NAME
|
if (TREE_CODE (t) == SSA_NAME
|
||||||
&& !defined_in_sese_p (t, region))
|
&& !defined_in_sese_p (t, region))
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
if (TREE_CODE (t) != SSA_NAME
|
if (!loop_in_sese_p (loop, region))
|
||||||
|| loop_in_sese_p (loop, region))
|
loop = NULL;
|
||||||
/* 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);
|
return instantiate_scev (region.entry, loop,
|
||||||
def_loop = loop_containing_stmt (def);
|
analyze_scalar_evolution (loop, t));
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
return instantiate_scev (region.entry, loop, t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true if BB is empty, contains only DEBUG_INSNs. */
|
/* Return true if BB is empty, contains only DEBUG_INSNs. */
|
||||||
|
|
|
||||||
|
|
@ -2358,11 +2358,9 @@ instantiate_scev_name (edge instantiate_below,
|
||||||
struct loop *def_loop;
|
struct loop *def_loop;
|
||||||
basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (chrec));
|
basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (chrec));
|
||||||
|
|
||||||
/* A parameter (or loop invariant and we do not want to include
|
/* A parameter, nothing to do. */
|
||||||
evolutions in outer loops), nothing to do. */
|
|
||||||
if (!def_bb
|
if (!def_bb
|
||||||
|| loop_depth (def_bb->loop_father) == 0
|
|| !dominated_by_p (CDI_DOMINATORS, def_bb, instantiate_below->dest))
|
||||||
|| ! dominated_by_p (CDI_DOMINATORS, def_bb, instantiate_below->dest))
|
|
||||||
return chrec;
|
return chrec;
|
||||||
|
|
||||||
/* We cache the value of instantiated variable to avoid exponential
|
/* We cache the value of instantiated variable to avoid exponential
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue