LoopRotation: Check some invariants of the dominator updating code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-09-01 12:04:51 +00:00
parent 8365e9bcc2
commit 64f30e3eed

View File

@ -418,6 +418,9 @@ bool LoopRotate::rotateLoop(Loop *L) {
for (unsigned I = 0, E = HeaderChildren.size(); I != E; ++I) for (unsigned I = 0, E = HeaderChildren.size(); I != E; ++I)
DT->changeImmediateDominator(HeaderChildren[I], OrigPreheaderNode); DT->changeImmediateDominator(HeaderChildren[I], OrigPreheaderNode);
assert(DT->getNode(Exit)->getIDom() == OrigPreheaderNode);
assert(DT->getNode(NewHeader)->getIDom() == OrigPreheaderNode);
// Update OrigHeader to be dominated by the new header block. // Update OrigHeader to be dominated by the new header block.
DT->changeImmediateDominator(OrigHeader, OrigLatch); DT->changeImmediateDominator(OrigHeader, OrigLatch);
} }