forked from OSchip/llvm-project
LSR, correct fix for rdar://9786536. Silly casting bug.
llvm-svn: 135654
This commit is contained in:
parent
6d54d89af1
commit
bd243d0dfe
|
@ -1480,8 +1480,8 @@ void LSRInstance::OptimizeShadowIV() {
|
||||||
ConstantInt *Init = dyn_cast<ConstantInt>(PH->getIncomingValue(Entry));
|
ConstantInt *Init = dyn_cast<ConstantInt>(PH->getIncomingValue(Entry));
|
||||||
if (!Init) continue;
|
if (!Init) continue;
|
||||||
Constant *NewInit = ConstantFP::get(DestTy, IsSigned ?
|
Constant *NewInit = ConstantFP::get(DestTy, IsSigned ?
|
||||||
Init->getSExtValue() :
|
(double)Init->getSExtValue() :
|
||||||
Init->getZExtValue());
|
(double)Init->getZExtValue());
|
||||||
|
|
||||||
BinaryOperator *Incr =
|
BinaryOperator *Incr =
|
||||||
dyn_cast<BinaryOperator>(PH->getIncomingValue(Latch));
|
dyn_cast<BinaryOperator>(PH->getIncomingValue(Latch));
|
||||||
|
|
|
@ -25,7 +25,7 @@ for.end:
|
||||||
|
|
||||||
; Now check that the computed double constant is correct.
|
; Now check that the computed double constant is correct.
|
||||||
; CHECK: @doubleIV
|
; CHECK: @doubleIV
|
||||||
; CHECK: phi double [ 0x43F0000000000000, %entry ]
|
; CHECK: phi double [ -3.900000e+01, %entry ]
|
||||||
; CHECK: br
|
; CHECK: br
|
||||||
define void @doubleIV() nounwind {
|
define void @doubleIV() nounwind {
|
||||||
entry:
|
entry:
|
||||||
|
|
Loading…
Reference in New Issue