[graphite] discard scops for which entry==exit
authorAditya Kumar <aditya.k7@samsung.com>
Wed, 15 Jul 2015 21:37:01 +0000 (21:37 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Wed, 15 Jul 2015 21:37:01 +0000 (21:37 +0000)
In this patch we discard the scops where entry and exit are the same BB.
This is an effort to remove graphite-scop-detection.c:limit_scops.
Removing the limit_scops function introduces correctness regressions.
We are making relevant changes in incremental steps to fix those bugs,
and finally we intend to remove limit_scops.

2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
                Sebastian Pop <s.pop@samsung.com>

        * graphite-scop-detection.c (build_scops_1): Discard scops for which entry==exit

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

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

index 6600494d878e0f2d892dec94dbbfcf8979fcd369..82ef7ecddcc6b36812c18a61697cc8ff22288a20 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-15  Aditya Kumar  <aditya.k7@samsung.com>
+           Sebastian Pop <s.pop@samsung.com>
+
+        * graphite-scop-detection.c (build_scops_1): Discard scops for
+       which entry==exit.
+
 2015-07-15  Aditya Kumar  <aditya.k7@samsung.com>
             Sebastian Pop <s.pop@samsung.com>
 
index b45a6823df17793102c197d5efe9f3d72ead9d7e..4fb4e028ac1e413e2367eb3003f9db466fedaae1 100644 (file)
@@ -794,7 +794,14 @@ build_scops_1 (basic_block current, loop_p outermost_loop,
     {
       open_scop.exit = sinfo.exit;
       gcc_assert (open_scop.exit);
-      scops->safe_push (open_scop);
+      if (open_scop.entry != open_scop.exit)
+       scops->safe_push (open_scop);
+      else
+       {
+         sinfo.difficult = true;
+         sinfo.exits = false;
+         sinfo.exit = NULL;
+       }
     }
 
   result.exit = sinfo.exit;