diff options
author | John McCall <rjmccall@apple.com> | 2010-02-13 23:40:16 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-13 23:40:16 +0000 |
commit | 6d09ab8ba2217bcf5a55f0c421d4787e223fc91b (patch) | |
tree | 78cef3bc58afe199026ae2ca9d1d35857d3afe0a /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | 77ffe3b31e32fbbcb06e71c8a68129df6266a492 (diff) |
Make LSR not crash if invoked without target lowering info, e.g. if invoked
from opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96135 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, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 8dba947d04..d3c92e77a0 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1535,10 +1535,10 @@ LSRInstance::OptimizeLoopTermCond() { const Type *AccessTy = getAccessType(UI->getUser()); TargetLowering::AddrMode AM; AM.Scale = D->getValue()->getSExtValue(); - if (TLI->isLegalAddressingMode(AM, AccessTy)) + if (TLI && TLI->isLegalAddressingMode(AM, AccessTy)) goto decline_post_inc; AM.Scale = -AM.Scale; - if (TLI->isLegalAddressingMode(AM, AccessTy)) + if (TLI && TLI->isLegalAddressingMode(AM, AccessTy)) goto decline_post_inc; } } |