diff options
author | Owen Anderson <resistor@mac.com> | 2007-11-27 03:43:35 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-11-27 03:43:35 +0000 |
commit | d735ee85dbab8e4f66f9ec157f19956e0d11ec7a (patch) | |
tree | ab14008be184ab6c761122865aa954c9b9b2d2d9 /lib/Transforms | |
parent | af9ac8f8212a062291e218ea0dea90a2e81dcf66 (diff) | |
download | external_llvm-d735ee85dbab8e4f66f9ec157f19956e0d11ec7a.zip external_llvm-d735ee85dbab8e4f66f9ec157f19956e0d11ec7a.tar.gz external_llvm-d735ee85dbab8e4f66f9ec157f19956e0d11ec7a.tar.bz2 |
Make LoopInfoBase more generic, in preparation for having MachineLoopInfo. This involves a small interface change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/LoopRotation.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopUnroll.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopUnswitch.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Utils/BasicBlockUtils.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/BreakCriticalEdges.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/CloneLoop.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 8 |
7 files changed, 15 insertions, 15 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index 798143d..587f5db 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -451,7 +451,7 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) { NewHeader); LoopInfo &LI = LPM.getAnalysis<LoopInfo>(); if (Loop *PL = LI.getLoopFor(OrigPreHeader)) - PL->addBasicBlockToLoop(NewPreHeader, LI); + PL->addBasicBlockToLoop(NewPreHeader, LI.getBase()); new BranchInst(NewHeader, NewPreHeader); BranchInst *OrigPH_BI = cast<BranchInst>(OrigPreHeader->getTerminator()); diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index d518e3a..f1a6df4 100644 --- a/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/lib/Transforms/Scalar/LoopUnroll.cpp @@ -358,7 +358,7 @@ bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) { VI != VE; ++VI) LastValueMap[VI->first] = VI->second; - L->addBasicBlockToLoop(New, *LI); + L->addBasicBlockToLoop(New, LI->getBase()); // Add phi entries for newly created values to all exit blocks except // the successor of the latch block. The successor of the exit block will diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 0c35b11..e413b94 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -542,7 +542,7 @@ static Loop *CloneLoop(Loop *L, Loop *PL, DenseMap<const Value*, Value*> &VM, for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E; ++I) if (LI->getLoopFor(*I) == L) - New->addBasicBlockToLoop(cast<BasicBlock>(VM[*I]), *LI); + New->addBasicBlockToLoop(cast<BasicBlock>(VM[*I]), LI->getBase()); // Add all of the subloops to the new loop. for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) @@ -793,14 +793,14 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val, if (ParentLoop) { // Make sure to add the cloned preheader and exit blocks to the parent loop // as well. - ParentLoop->addBasicBlockToLoop(NewBlocks[0], *LI); + ParentLoop->addBasicBlockToLoop(NewBlocks[0], LI->getBase()); } for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) { BasicBlock *NewExit = cast<BasicBlock>(ValueMap[ExitBlocks[i]]); // The new exit block should be in the same loop as the old one. if (Loop *ExitBBLoop = LI->getLoopFor(ExitBlocks[i])) - ExitBBLoop->addBasicBlockToLoop(NewExit, *LI); + ExitBBLoop->addBasicBlockToLoop(NewExit, LI->getBase()); assert(NewExit->getTerminator()->getNumSuccessors() == 1 && "Exit block should have been split to have one successor!"); diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 0ed3ed6..5a143f9 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -163,7 +163,7 @@ BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) { // The new block lives in whichever loop the old one did. if (Loop *L = LI.getLoopFor(Old)) - L->addBasicBlockToLoop(New, LI); + L->addBasicBlockToLoop(New, LI.getBase()); if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) { diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index e28d59d..d215b69 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -250,13 +250,13 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, if (Loop *DestLoop = LI->getLoopFor(DestBB)) { if (TIL == DestLoop) { // Both in the same loop, the NewBB joins loop. - DestLoop->addBasicBlockToLoop(NewBB, *LI); + DestLoop->addBasicBlockToLoop(NewBB, LI->getBase()); } else if (TIL->contains(DestLoop->getHeader())) { // Edge from an outer loop to an inner loop. Add to the outer loop. - TIL->addBasicBlockToLoop(NewBB, *LI); + TIL->addBasicBlockToLoop(NewBB, LI->getBase()); } else if (DestLoop->contains(TIL->getHeader())) { // Edge from an inner loop to an outer loop. Add to the outer loop. - DestLoop->addBasicBlockToLoop(NewBB, *LI); + DestLoop->addBasicBlockToLoop(NewBB, LI->getBase()); } else { // Edge from two loops with no containment relation. Because these // are natural loops, we know that the destination block must be the @@ -265,7 +265,7 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, assert(DestLoop->getHeader() == DestBB && "Should not create irreducible loops!"); if (Loop *P = DestLoop->getParentLoop()) - P->addBasicBlockToLoop(NewBB, *LI); + P->addBasicBlockToLoop(NewBB, LI->getBase()); } } } diff --git a/lib/Transforms/Utils/CloneLoop.cpp b/lib/Transforms/Utils/CloneLoop.cpp index 61d25f2..34ed132 100644 --- a/lib/Transforms/Utils/CloneLoop.cpp +++ b/lib/Transforms/Utils/CloneLoop.cpp @@ -109,7 +109,7 @@ Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI, ValueMap[BB] = NewBB; if (P) LPM->cloneBasicBlockSimpleAnalysis(BB, NewBB, L); - NewLoop->addBasicBlockToLoop(NewBB, *LI); + NewLoop->addBasicBlockToLoop(NewBB, LI->getBase()); NewBlocks.push_back(NewBB); } diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 21a4e23..73f5db0 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -380,7 +380,7 @@ void LoopSimplify::InsertPreheaderForLoop(Loop *L) { // We know that we have loop information to update... update it now. if (Loop *Parent = L->getParentLoop()) - Parent->addBasicBlockToLoop(NewBB, *LI); + Parent->addBasicBlockToLoop(NewBB, LI->getBase()); DT->splitBlock(NewBB); if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) @@ -412,7 +412,7 @@ BasicBlock *LoopSimplify::RewriteLoopExitBlock(Loop *L, BasicBlock *Exit) { while (SuccLoop && !SuccLoop->contains(L->getHeader())) SuccLoop = SuccLoop->getParentLoop(); if (SuccLoop) - SuccLoop->addBasicBlockToLoop(NewBB, *LI); + SuccLoop->addBasicBlockToLoop(NewBB, LI->getBase()); // Update Dominator Information DT->splitBlock(NewBB); @@ -558,7 +558,7 @@ Loop *LoopSimplify::SeparateNestedLoop(Loop *L) { // This block is going to be our new header block: add it to this loop and all // parent loops. - NewOuter->addBasicBlockToLoop(NewBB, *LI); + NewOuter->addBasicBlockToLoop(NewBB, LI->getBase()); // L is now a subloop of our outer loop. NewOuter->addChildLoop(L); @@ -693,7 +693,7 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) { // Update Loop Information - we know that this block is now in the current // loop and all parent loops. - L->addBasicBlockToLoop(BEBlock, *LI); + L->addBasicBlockToLoop(BEBlock, LI->getBase()); // Update dominator information DT->splitBlock(BEBlock); |