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/LoopStrengthReduce.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/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index e20fb16fb1..288dd476e9 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -2528,6 +2528,10 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager &LPM) { SE = &getAnalysis<ScalarEvolution>(); Changed = false; + // If LoopSimplify form is not available, stay out of trouble. + if (!L->getLoopPreheader() || !L->getLoopLatch()) + return false; + if (!IU->IVUsesByStride.empty()) { DEBUG(errs() << "\nLSR on \"" << L->getHeader()->getParent()->getName() << "\" "; |