diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 8618853af68..bd5ad4e264f 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -18823,7 +18823,7 @@ static SDValue PerformSINT_TO_FPCombine(SDNode *N, SelectionDAG &DAG, if (!Ld->isVolatile() && !N->getValueType(0).isVector() && ISD::isNON_EXTLoad(Op0.getNode()) && Op0.hasOneUse() && !XTLI->getSubtarget()->is64Bit() && - !DAG.getTargetLoweringInfo().isTypeLegal(VT)) { + VT == MVT::i64) { SDValue FILDChain = XTLI->BuildFILD(SDValue(N, 0), Ld->getValueType(0), Ld->getChain(), Op0, DAG); DAG.ReplaceAllUsesOfValueWith(Op0.getValue(1), FILDChain.getValue(1)); diff --git a/test/CodeGen/X86/2011-06-03-x87chain.ll b/test/CodeGen/X86/2011-06-03-x87chain.ll index ce63c74fbdf..5275b6889bf 100644 --- a/test/CodeGen/X86/2011-06-03-x87chain.ll +++ b/test/CodeGen/X86/2011-06-03-x87chain.ll @@ -29,3 +29,21 @@ entry: store float %conv, float* %f, align 4 ret float %conv } + +define void @PR17495() { +entry: + br i1 undef, label %while.end, label %while.body + +while.body: ; preds = %while.body, %entry + %x.1.copyload = load i24* undef, align 1 + %conv = sitofp i24 %x.1.copyload to float + %div = fmul float %conv, 0x3E80000000000000 + store float %div, float* undef, align 4 + br i1 false, label %while.end, label %while.body + +while.end: ; preds = %while.body, %entry + ret void + +; CHECK-LABEL: @PR17495 +; CHECK-NOT: fildll +}