Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 225018f

Browse files
committed
[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. git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@306398 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 6d2342c commit 225018f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/CodeGen/CodeGeneration.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT,
178178
BBPair StartExitBlocks =
179179
executeScopConditionally(S, Builder.getTrue(), DT, RI, LI);
180180
BasicBlock *StartBlock = std::get<0>(StartExitBlocks);
181+
BasicBlock *ExitBlock = std::get<1>(StartExitBlocks);
181182

182183
removeLifetimeMarkers(R);
183184
auto *SplitBlock = StartBlock->getSinglePredecessor();
@@ -194,10 +195,7 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT,
194195
P.initialize();
195196
P.insertRegionStart(SplitBlock->getTerminator());
196197

197-
BasicBlock *MergeBlock = SplitBlock->getTerminator()
198-
->getSuccessor(0)
199-
->getUniqueSuccessor()
200-
->getUniqueSuccessor();
198+
BasicBlock *MergeBlock = ExitBlock->getUniqueSuccessor();
201199
P.insertRegionEnd(MergeBlock->getTerminator());
202200
}
203201

0 commit comments

Comments
 (0)