[llvm] 9b515b6 - [LegalizeTypes] Remove PromoteFloat support form ExpandIntRes_LLROUND_LLRINT.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 13:48:41 PST 2019


Author: Craig Topper
Date: 2019-11-17T13:31:30-08:00
New Revision: 9b515b6dd919cbd67ba12c01530708c5617e288f

URL: https://github.com/llvm/llvm-project/commit/9b515b6dd919cbd67ba12c01530708c5617e288f
DIFF: https://github.com/llvm/llvm-project/commit/9b515b6dd919cbd67ba12c01530708c5617e288f.diff

LOG: [LegalizeTypes] Remove PromoteFloat support form ExpandIntRes_LLROUND_LLRINT.

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.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 295a32326f70..da822e2d0755 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -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;


        


More information about the llvm-commits mailing list