From: Evan Cheng Date: Sun, 22 Feb 2009 07:31:19 +0000 (+0000) Subject: Only try to sink immediate when TLI is not null. It needs to check if immediate would... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3cd389de398e95b1633d310fc9c4af5b9f84b7af;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 2099ceace51..1817e583747 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);