diff options
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 | ||||
-rw-r--r-- | test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 9286481..e790715 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/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/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll b/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll index aecb06c..5d9ed64 100644 --- a/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll +++ b/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: |