OSDN Git Service

[X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering.
authorCraig Topper <craig.topper@intel.com>
Mon, 4 Dec 2017 05:38:44 +0000 (05:38 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 4 Dec 2017 05:38:44 +0000 (05:38 +0000)
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

lib/Target/X86/X86ISelLowering.cpp

index 503e846..48e6c31 100644 (file)
@@ -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);