Only try to sink immediate when TLI is not null. It needs to check if immediate would fit in target addressing field.

llvm-svn: 65268
This commit is contained in:
Evan Cheng 2009-02-22 07:31:19 +00:00
parent ada4032dc9
commit ba3f6fa814

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