mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-30 00:32:53 +00:00
SplitBlock should only attempt to update LoopInfo if it is actually being used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91b6f97ce4
commit
a90793b431
@ -240,16 +240,15 @@ BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, Pass *P) {
|
|||||||
/// the loop info is updated.
|
/// the loop info is updated.
|
||||||
///
|
///
|
||||||
BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) {
|
BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) {
|
||||||
|
|
||||||
LoopInfo &LI = P->getAnalysis<LoopInfo>();
|
|
||||||
BasicBlock::iterator SplitIt = SplitPt;
|
BasicBlock::iterator SplitIt = SplitPt;
|
||||||
while (isa<PHINode>(SplitIt))
|
while (isa<PHINode>(SplitIt))
|
||||||
++SplitIt;
|
++SplitIt;
|
||||||
BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split");
|
BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split");
|
||||||
|
|
||||||
// The new block lives in whichever loop the old one did.
|
// The new block lives in whichever loop the old one did.
|
||||||
if (Loop *L = LI.getLoopFor(Old))
|
if (LoopInfo* LI = P->getAnalysisToUpdate<LoopInfo>())
|
||||||
L->addBasicBlockToLoop(New, LI.getBase());
|
if (Loop *L = LI->getLoopFor(Old))
|
||||||
|
L->addBasicBlockToLoop(New, LI->getBase());
|
||||||
|
|
||||||
if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>())
|
if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user