summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-13 23:40:16 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-13 23:40:16 +0000
commit0daaf13b977be49d822ebdb213108414d9571d74 (patch)
tree77578f086347335790a6f39aad2367f3bd5d2084 /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent843a4cc43c6b4205d3806859e0d1df2c8a9a2afe (diff)
downloadbcm5719-llvm-0daaf13b977be49d822ebdb213108414d9571d74.tar.gz
bcm5719-llvm-0daaf13b977be49d822ebdb213108414d9571d74.zip
Make LSR not crash if invoked without target lowering info, e.g. if invoked
from opt. llvm-svn: 96135
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 8dba947d04a..d3c92e77a09 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/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;
}
}
OpenPOWER on IntegriCloud