diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-05 21:11:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-05 21:11:53 +0000 |
commit | 03e896bd6073efc4523d8bcd0239d6ed62126db7 (patch) | |
tree | 940b395910c450d7c9e00a014e1592e4982bdca8 /lib/Transforms/Scalar/LoopRotation.cpp | |
parent | 7040d6e2f5d503e9948b9caff940a66238a0c605 (diff) |
Update various Loop optimization passes to cope with the possibility that
LoopSimplify form may not be available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopRotation.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index a18d9d4483..5004483e04 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -104,17 +104,18 @@ bool LoopRotate::runOnLoop(Loop *Lp, LPPassManager &LPM) { bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) { L = Lp; - OrigHeader = L->getHeader(); OrigPreHeader = L->getLoopPreheader(); + if (!OrigPreHeader) return false; + OrigLatch = L->getLoopLatch(); + if (!OrigLatch) return false; + + OrigHeader = L->getHeader(); // If the loop has only one block then there is not much to rotate. if (L->getBlocks().size() == 1) return false; - assert(OrigHeader && OrigLatch && OrigPreHeader && - "Loop is not in canonical form"); - // If the loop header is not one of the loop exiting blocks then // either this loop is already rotated or it is not // suitable for loop rotation transformations. |