[LegalizeTypes] Remove PromoteFloat support form ExpandIntRes_LLROUND_LLRINT.
authorCraig Topper <craig.topper@gmail.com>
Sun, 17 Nov 2019 03:46:53 +0000 (19:46 -0800)
committerCraig Topper <craig.topper@gmail.com>
Sun, 17 Nov 2019 21:31:30 +0000 (13:31 -0800)
This code isn't exercised, and was in the wrong place. If we need
this, we would need to promote the type before figuring out which
libcall to use.

I'm choosing to remove it rather than fixing since we don't
support PromoteFloat for LRINT/LROUND/LLRINT/LLROUND when the
result type is legal so I don't see much reason to support it
for the case where the result type isn't legal.

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

index 295a32326f70e9ba92baefec5ea567ed07d7a7e5..da822e2d07550dfc246fc112eea5ab526779572f 100644 (file)
@@ -2586,7 +2586,12 @@ void DAGTypeLegalizer::ExpandIntRes_FP_TO_UINT(SDNode *N, SDValue &Lo,
 
 void DAGTypeLegalizer::ExpandIntRes_LLROUND_LLRINT(SDNode *N, SDValue &Lo,
                                                    SDValue &Hi) {
-  EVT VT = N->getOperand(0).getValueType().getSimpleVT().SimpleTy;
+  SDValue Op = N->getOperand(0);
+
+  assert(getTypeAction(Op.getValueType()) != TargetLowering::TypePromoteFloat &&
+         "Input type needs to be promoted!");
+
+  EVT VT = Op.getValueType();
 
   RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
   if (N->getOpcode() == ISD::LLROUND) {
@@ -2616,10 +2621,6 @@ void DAGTypeLegalizer::ExpandIntRes_LLROUND_LLRINT(SDNode *N, SDValue &Lo,
   } else
     llvm_unreachable("Unexpected opcode!");
 
-  SDValue Op = N->getOperand(0);
-  if (getTypeAction(Op.getValueType()) == TargetLowering::TypePromoteFloat)
-    Op = GetPromotedFloat(Op);
-
   SDLoc dl(N);
   EVT RetVT = N->getValueType(0);
   TargetLowering::MakeLibCallOptions CallOptions;