]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
check for unstructured control flow
authorAditya Kumar <aditya.k7@samsung.com>
Thu, 21 Jan 2016 02:13:42 +0000 (02:13 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Thu, 21 Jan 2016 02:13:42 +0000 (02:13 +0000)
* 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

gcc/ChangeLog
gcc/graphite-scop-detection.c

index 4b593a8cc65fc651e89d46e397ab6c7eb5600c9c..7e5bf1a67621a1959e7e5abf09fc6d654c8df4ab 100644 (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>
 
index d1b0fec1d4b596b828da9d91fe06160d1dd12c27..3f268a56c37089017cfd892778235b0a77d89ff6 100644 (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))