Do not allow irreducible loops/regions in a scop
Irreducible regions are not going to be optimized by ISL so discard them early. Passes bootstrap and regtest. gcc/ChangeLog: 2015-11-06 Aditya Kumar <aditya.k7@samsung.com> * graphite-scop-detection.c (scop_detection::merge_sese): Entry and exit edges should not be a part of irreducible loop. (scop_detection::can_represent_loop_1): Loops should not be irreducible. (scop_detection::harmful_stmt_in_region): All the basic block should belong to reducible loops. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r229888
This commit is contained in:
parent
246cc06002
commit
1167ebe707
|
@ -1,3 +1,13 @@
|
||||||
|
2015-11-06 Aditya Kumar <aditya.k7@samsung.com>
|
||||||
|
Sebastian Pop <s.pop@samsung.com>
|
||||||
|
|
||||||
|
* graphite-scop-detection.c (scop_detection::merge_sese): Entry
|
||||||
|
and exit edges should not be a part of irreducible loop.
|
||||||
|
(scop_detection::can_represent_loop_1): Loops should not be
|
||||||
|
irreducible.
|
||||||
|
(scop_detection::harmful_stmt_in_region): All the basic block
|
||||||
|
should belong to reducible loops.
|
||||||
|
|
||||||
2015-11-06 Christophe Lyon <christophe.lyon@linaro.org>
|
2015-11-06 Christophe Lyon <christophe.lyon@linaro.org>
|
||||||
|
|
||||||
* config/aarch64/aarch64-simd-builtins.def: Update builtins
|
* config/aarch64/aarch64-simd-builtins.def: Update builtins
|
||||||
|
|
|
@ -794,7 +794,8 @@ scop_detection::merge_sese (sese_l first, sese_l second) const
|
||||||
get_entry_bb (second));
|
get_entry_bb (second));
|
||||||
|
|
||||||
edge entry = get_nearest_dom_with_single_entry (dom);
|
edge entry = get_nearest_dom_with_single_entry (dom);
|
||||||
if (!entry)
|
|
||||||
|
if (!entry || (entry->flags & EDGE_IRREDUCIBLE_LOOP))
|
||||||
return invalid_sese;
|
return invalid_sese;
|
||||||
|
|
||||||
basic_block pdom = nearest_common_dominator (CDI_POST_DOMINATORS,
|
basic_block pdom = nearest_common_dominator (CDI_POST_DOMINATORS,
|
||||||
|
@ -803,7 +804,8 @@ scop_detection::merge_sese (sese_l first, sese_l second) const
|
||||||
pdom = nearest_common_dominator (CDI_POST_DOMINATORS, dom, pdom);
|
pdom = nearest_common_dominator (CDI_POST_DOMINATORS, dom, pdom);
|
||||||
|
|
||||||
edge exit = get_nearest_pdom_with_single_exit (pdom);
|
edge exit = get_nearest_pdom_with_single_exit (pdom);
|
||||||
if (!exit)
|
|
||||||
|
if (!exit || (exit->flags & EDGE_IRREDUCIBLE_LOOP))
|
||||||
return invalid_sese;
|
return invalid_sese;
|
||||||
|
|
||||||
sese_l combined (entry, exit);
|
sese_l combined (entry, exit);
|
||||||
|
@ -923,6 +925,7 @@ scop_detection::can_represent_loop_1 (loop_p loop, sese_l scop)
|
||||||
struct tree_niter_desc niter_desc;
|
struct tree_niter_desc niter_desc;
|
||||||
|
|
||||||
return single_exit (loop)
|
return single_exit (loop)
|
||||||
|
&& !(loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP)
|
||||||
&& number_of_iterations_exit (loop, single_exit (loop), &niter_desc, false)
|
&& number_of_iterations_exit (loop, single_exit (loop), &niter_desc, false)
|
||||||
&& niter_desc.control.no_overflow
|
&& niter_desc.control.no_overflow
|
||||||
&& (niter = number_of_latch_executions (loop))
|
&& (niter = number_of_latch_executions (loop))
|
||||||
|
@ -1053,6 +1056,10 @@ scop_detection::harmful_stmt_in_region (sese_l scop) const
|
||||||
if (!dominated_by_p (CDI_POST_DOMINATORS, bb, exit_bb))
|
if (!dominated_by_p (CDI_POST_DOMINATORS, bb, exit_bb))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* The basic block should not be part of an irreducible loop. */
|
||||||
|
if (bb->flags & BB_IRREDUCIBLE_LOOP)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (harmful_stmt_in_bb (scop, bb))
|
if (harmful_stmt_in_bb (scop, bb))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue