summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-22 07:31:19 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-22 07:31:19 +0000
commit3cd389de398e95b1633d310fc9c4af5b9f84b7af (patch)
tree4704c15d51b46d0ea92b2a47d05a51b73974c2cb /lib
parentbdf0d7cfc14c144b3168db7acc7cacf72209812a (diff)
downloadllvm-3cd389de398e95b1633d310fc9c4af5b9f84b7af.tar.gz
llvm-3cd389de398e95b1633d310fc9c4af5b9f84b7af.tar.bz2
llvm-3cd389de398e95b1633d310fc9c4af5b9f84b7af.tar.xz
Only try to sink immediate when TLI is not null. It needs to check if immediate would fit in target addressing field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 2099ceace5..1817e58374 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1828,7 +1828,7 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
// If all uses are addresses, consider sinking the immediate part of the
// common expression back into uses if they can fit in the immediate fields.
- if (HaveCommonExprs && AllUsesAreAddresses) {
+ if (TLI && HaveCommonExprs && AllUsesAreAddresses) {
SCEVHandle NewCommon = CommonExprs;
SCEVHandle Imm = SE->getIntegerSCEV(0, ReplacedTy);
MoveImmediateValues(TLI, ReplacedTy, NewCommon, Imm, true, L, SE);