summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/BreakCriticalEdges.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-11-27 03:43:35 +0000
committerOwen Anderson <resistor@mac.com>2007-11-27 03:43:35 +0000
commitd735ee85dbab8e4f66f9ec157f19956e0d11ec7a (patch)
treeab14008be184ab6c761122865aa954c9b9b2d2d9 /lib/Transforms/Utils/BreakCriticalEdges.cpp
parentaf9ac8f8212a062291e218ea0dea90a2e81dcf66 (diff)
downloadllvm-d735ee85dbab8e4f66f9ec157f19956e0d11ec7a.tar.gz
llvm-d735ee85dbab8e4f66f9ec157f19956e0d11ec7a.tar.bz2
llvm-d735ee85dbab8e4f66f9ec157f19956e0d11ec7a.tar.xz
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/Utils/BreakCriticalEdges.cpp')
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index e28d59d7c3..d215b693d2 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());
}
}
}