summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-07-21 01:45:54 +0000
committerAndrew Trick <atrick@apple.com>2011-07-21 01:45:54 +0000
commitbd243d0dfe3cd3fa8dc59030a578d5dec72292c7 (patch)
tree1a66dee3e1dfbbb08c4528444db8d58b7bf7d553
parent6d54d89af1d317ea95b8c787a1d4fd8836641906 (diff)
downloadbcm5719-llvm-bd243d0dfe3cd3fa8dc59030a578d5dec72292c7.tar.gz
bcm5719-llvm-bd243d0dfe3cd3fa8dc59030a578d5dec72292c7.zip
LSR, correct fix for rdar://9786536. Silly casting bug.
llvm-svn: 135654
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp4
-rw-r--r--llvm/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 92864817aee..e79071535bd 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1480,8 +1480,8 @@ void LSRInstance::OptimizeShadowIV() {
ConstantInt *Init = dyn_cast<ConstantInt>(PH->getIncomingValue(Entry));
if (!Init) continue;
Constant *NewInit = ConstantFP::get(DestTy, IsSigned ?
- Init->getSExtValue() :
- Init->getZExtValue());
+ (double)Init->getSExtValue() :
+ (double)Init->getZExtValue());
BinaryOperator *Incr =
dyn_cast<BinaryOperator>(PH->getIncomingValue(Latch));
diff --git a/llvm/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll b/llvm/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll
index aecb06cfb87..5d9ed64ef42 100644
--- a/llvm/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll
+++ b/llvm/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll
@@ -25,7 +25,7 @@ for.end:
; Now check that the computed double constant is correct.
; CHECK: @doubleIV
-; CHECK: phi double [ 0x43F0000000000000, %entry ]
+; CHECK: phi double [ -3.900000e+01, %entry ]
; CHECK: br
define void @doubleIV() nounwind {
entry:
OpenPOWER on IntegriCloud