Index: lib/Target/X86/X86ISelLowering.cpp =================================================================== --- lib/Target/X86/X86ISelLowering.cpp +++ lib/Target/X86/X86ISelLowering.cpp @@ -235,7 +235,7 @@ } } else { setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Promote); - setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Promote); + setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom); } // Promote i1/i8 FP_TO_SINT to larger FP_TO_SINTS's, as X86 doesn't have Index: test/CodeGen/X86/sitofp.ll =================================================================== --- /dev/null +++ test/CodeGen/X86/sitofp.ll @@ -0,0 +1,17 @@ +; RUN: llc < %s + +target triple = "i386-unknown-linux-gnu" + +define void @foo() #0 { +entry: + %a = alloca i16, align 2 + %b = alloca double, align 4 + %0 = load i16, i16* %a, align 2 + %conv = zext i16 %0 to i32 + %conv1 = sitofp i32 %conv to double + %add = fadd double %conv1, 0.000000e+00 + store double %add, double* %b, align 4 + ret void +} + +attributes #0 = { "use-soft-float"="true" }