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
This commit is contained in:
Chris Lattner
2011-01-11 07:47:59 +00:00
parent 9651870815
commit 93767fdb61
2 changed files with 36 additions and 6 deletions
+5 -6
View File
@@ -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;