From: Craig Topper Date: Mon, 4 Dec 2017 05:38:44 +0000 (+0000) Subject: [X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18d898c462a6128a93f511fa696f517600c1783b;p=llvm [X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering. We already do this as a DAG combine. The version during lowering can only trigger if known bits changes something that improves known bits analysis. But this means we should be improving known bits analysis to work on the unlowered form instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319640 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 503e8467085..48e6c31be6b 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -15820,12 +15820,6 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op, SDLoc dl(Op); auto PtrVT = getPointerTy(DAG.getDataLayout()); - // Since UINT_TO_FP is legal (it's marked custom), dag combiner won't - // optimize it to a SINT_TO_FP when the sign bit is known zero. Perform - // the optimization here. - if (DAG.SignBitIsZero(N0)) - return DAG.getNode(ISD::SINT_TO_FP, dl, Op.getValueType(), N0); - if (Op.getSimpleValueType().isVector()) return lowerUINT_TO_FP_vec(Op, DAG);