forked from OSchip/llvm-project
Use an ArrayRef instead of explicit vector type.
llvm-svn: 155816
This commit is contained in:
parent
32d5488f64
commit
325e6cd9cb
|
@ -117,12 +117,12 @@ bool llvm::isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CreatePHIsForSplitLoopExit - When a loop exit edge is split, LCSSA form
|
/// createPHIsForSplitLoopExit - When a loop exit edge is split, LCSSA form
|
||||||
/// may require new PHIs in the new exit block. This function inserts the
|
/// may require new PHIs in the new exit block. This function inserts the
|
||||||
/// new PHIs, as needed. Preds is a list of preds inside the loop, SplitBB
|
/// new PHIs, as needed. Preds is a list of preds inside the loop, SplitBB
|
||||||
/// is the new loop exit block, and DestBB is the old loop exit, now the
|
/// is the new loop exit block, and DestBB is the old loop exit, now the
|
||||||
/// successor of SplitBB.
|
/// successor of SplitBB.
|
||||||
static void CreatePHIsForSplitLoopExit(SmallVectorImpl<BasicBlock *> &Preds,
|
static void createPHIsForSplitLoopExit(ArrayRef<BasicBlock *> Preds,
|
||||||
BasicBlock *SplitBB,
|
BasicBlock *SplitBB,
|
||||||
BasicBlock *DestBB) {
|
BasicBlock *DestBB) {
|
||||||
// SplitBB shouldn't have anything non-trivial in it yet.
|
// SplitBB shouldn't have anything non-trivial in it yet.
|
||||||
|
@ -335,11 +335,8 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||||
"Split point for loop exit is contained in loop!");
|
"Split point for loop exit is contained in loop!");
|
||||||
|
|
||||||
// Update LCSSA form in the newly created exit block.
|
// Update LCSSA form in the newly created exit block.
|
||||||
if (P->mustPreserveAnalysisID(LCSSAID)) {
|
if (P->mustPreserveAnalysisID(LCSSAID))
|
||||||
SmallVector<BasicBlock *, 1> OrigPred;
|
createPHIsForSplitLoopExit(TIBB, NewBB, DestBB);
|
||||||
OrigPred.push_back(TIBB);
|
|
||||||
CreatePHIsForSplitLoopExit(OrigPred, NewBB, DestBB);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For each unique exit block...
|
// For each unique exit block...
|
||||||
// FIXME: This code is functionally equivalent to the corresponding
|
// FIXME: This code is functionally equivalent to the corresponding
|
||||||
|
@ -374,7 +371,7 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||||
BasicBlock *NewExitBB =
|
BasicBlock *NewExitBB =
|
||||||
SplitBlockPredecessors(Exit, Preds, "split", P);
|
SplitBlockPredecessors(Exit, Preds, "split", P);
|
||||||
if (P->mustPreserveAnalysisID(LCSSAID))
|
if (P->mustPreserveAnalysisID(LCSSAID))
|
||||||
CreatePHIsForSplitLoopExit(Preds, NewExitBB, Exit);
|
createPHIsForSplitLoopExit(Preds, NewExitBB, Exit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue