[polly] r306398 - [NFC][CodeGen] Use the ExitBlock explicitly.

Andreas Simbuerger via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 04:33:22 PDT 2017


Author: simbuerg
Date: Tue Jun 27 04:33:22 2017
New Revision: 306398

URL: http://llvm.org/viewvc/llvm-project?rev=306398&view=rev
Log:
[NFC][CodeGen] Use the ExitBlock explicitly.

Before we would 'guess' the correct location for the MergeBlock
that got introduced when executing a Scop conditionally. This
implicitly depends on the situation that at this point during
CodeGen there will be nothing between polly.start and polly.exiting.

With this commit we explicitly state that we want the block that
directly follows polly.exiting.

Modified:
    polly/trunk/lib/CodeGen/CodeGeneration.cpp

Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=306398&r1=306397&r2=306398&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Tue Jun 27 04:33:22 2017
@@ -178,6 +178,7 @@ static bool CodeGen(Scop &S, IslAstInfo
   BBPair StartExitBlocks =
       executeScopConditionally(S, Builder.getTrue(), DT, RI, LI);
   BasicBlock *StartBlock = std::get<0>(StartExitBlocks);
+  BasicBlock *ExitBlock = std::get<1>(StartExitBlocks);
 
   removeLifetimeMarkers(R);
   auto *SplitBlock = StartBlock->getSinglePredecessor();
@@ -194,10 +195,7 @@ static bool CodeGen(Scop &S, IslAstInfo
     P.initialize();
     P.insertRegionStart(SplitBlock->getTerminator());
 
-    BasicBlock *MergeBlock = SplitBlock->getTerminator()
-                                 ->getSuccessor(0)
-                                 ->getUniqueSuccessor()
-                                 ->getUniqueSuccessor();
+    BasicBlock *MergeBlock = ExitBlock->getUniqueSuccessor();
     P.insertRegionEnd(MergeBlock->getTerminator());
   }
 




More information about the llvm-commits mailing list