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
This commit is contained in:
Evan Cheng 2009-02-22 07:31:19 +00:00
parent bdf0d7cfc1
commit 3cd389de39

View File

@ -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);