forked from OSchip/llvm-project
[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. llvm-svn: 306398
This commit is contained in:
parent
cdda23eb7c
commit
dbb0ef8e94
|
@ -178,6 +178,7 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT,
|
|||
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 &AI, LoopInfo &LI, DominatorTree &DT,
|
|||
P.initialize();
|
||||
P.insertRegionStart(SplitBlock->getTerminator());
|
||||
|
||||
BasicBlock *MergeBlock = SplitBlock->getTerminator()
|
||||
->getSuccessor(0)
|
||||
->getUniqueSuccessor()
|
||||
->getUniqueSuccessor();
|
||||
BasicBlock *MergeBlock = ExitBlock->getUniqueSuccessor();
|
||||
P.insertRegionEnd(MergeBlock->getTerminator());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue