From 69decbf0b2a5a6ae6b4dc3bd5730268e2c0296e5 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 22 Feb 2009 07:31:19 +0000 Subject: 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 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 2099ceace51..1817e583747 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/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); -- cgit v1.2.3