summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-11 07:47:59 +0000
committerChris Lattner <sabre@nondot.org>2011-01-11 07:47:59 +0000
commit93767fdb61dfff6ab13056b2a73209998ae4e786 (patch)
treef4f29b634b2ae119949ad0fc090e4cef924a892c /lib/Transforms/Scalar/LoopRotation.cpp
parent965187081538623b5ed76beafb6888c81dcc80f2 (diff)
downloadllvm-93767fdb61dfff6ab13056b2a73209998ae4e786.tar.gz
llvm-93767fdb61dfff6ab13056b2a73209998ae4e786.tar.bz2
llvm-93767fdb61dfff6ab13056b2a73209998ae4e786.tar.xz
remove a bogus assertion: the latch block of a loop is not
neccesarily an uncond branch to the header. This fixes PR8955 (the assertion tripping). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123219 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp
index d1c975f2e9..3bc4b1d2f1 100644
--- a/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/lib/Transforms/Scalar/LoopRotation.cpp
@@ -335,12 +335,11 @@ bool LoopRotate::rotateLoop(Loop *L) {
assert(L->getLoopPreheader() && "Invalid loop preheader after loop rotation");
assert(L->getLoopLatch() && "Invalid loop latch after loop rotation");
- // Now that the CFG and DomTree are in a consistent state again, merge the
- // OrigHeader block into OrigLatch. We know that they are joined by an
- // unconditional branch. This is just a cleanup so the emitted code isn't
- // too gross.
- bool DidIt = MergeBlockIntoPredecessor(OrigHeader, this);
- assert(DidIt && "Block merge failed??"); (void)DidIt;
+ // Now that the CFG and DomTree are in a consistent state again, try to merge
+ // the OrigHeader block into OrigLatch. This will succeed if they are
+ // connected by an unconditional branch. This is just a cleanup so the
+ // emitted code isn't too gross in this common case.
+ MergeBlockIntoPredecessor(OrigHeader, this);
++NumRotated;
return true;