mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +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.
|
||||
///
|
||||
BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) {
|
||||
|
||||
LoopInfo &LI = P->getAnalysis<LoopInfo>();
|
||||
BasicBlock::iterator SplitIt = SplitPt;
|
||||
while (isa<PHINode>(SplitIt))
|
||||
++SplitIt;
|
||||
BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split");
|
||||
|
||||
// The new block lives in whichever loop the old one did.
|
||||
if (Loop *L = LI.getLoopFor(Old))
|
||||
L->addBasicBlockToLoop(New, LI.getBase());
|
||||
if (LoopInfo* LI = P->getAnalysisToUpdate<LoopInfo>())
|
||||
if (Loop *L = LI->getLoopFor(Old))
|
||||
L->addBasicBlockToLoop(New, LI->getBase());
|
||||
|
||||
if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user