check for unstructured control flow

* graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
	Discard unstructured if-then-else regions.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r232657
This commit is contained in:
Aditya Kumar 2016-01-21 02:13:42 +00:00 committed by Sebastian Pop
parent d8d262cf80
commit 8f2252625a
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
* graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
Discard unstructured if-then-else regions.
2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>

View File

@ -1078,6 +1078,18 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
return true;
}
/* Check for unstructured control flow: CFG not generated by structured
if-then-else. */
if (bb->succs->length () > 1)
{
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->succs)
if (!dominated_by_p (CDI_POST_DOMINATORS, bb, e->dest)
&& !dominated_by_p (CDI_DOMINATORS, e->dest, bb))
return true;
}
/* Collect all loops in the current region. */
loop_p loop = bb->loop_father;
if (loop_in_sese_p (loop, scop))