mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-18 17:39:04 +00:00
Fix edge cases in handling basic block split.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40564 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
29381fb7cd
commit
c61ce1ad09
@ -616,7 +616,11 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) {
|
||||
PI != PE; ++PI)
|
||||
PredBlocks.push_back(*PI);
|
||||
|
||||
assert(!PredBlocks.empty() && "No predblocks??");
|
||||
if (PredBlocks.empty())
|
||||
// If NewBB does not have any predecessors then it is a entry block.
|
||||
// In this case, NewBB and its successor NewBBSucc dominates all
|
||||
// other blocks.
|
||||
return;
|
||||
|
||||
DominatorTree &DT = getAnalysis<DominatorTree>();
|
||||
bool NewBBDominatesNewBBSucc = true;
|
||||
@ -643,8 +647,13 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) {
|
||||
else
|
||||
++SetI;
|
||||
}
|
||||
|
||||
addBasicBlock(NewBB, Set);
|
||||
|
||||
DominanceFrontier::iterator NewBBI = find(NewBB);
|
||||
if (NewBBI != end()) {
|
||||
DominanceFrontier::DomSetType NewBBSet = NewBBI->second;
|
||||
NewBBSet.insert(Set.begin(), Set.end());
|
||||
} else
|
||||
addBasicBlock(NewBB, Set);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user