Skip to content

Commit 9b515b6

Browse files
committed
[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.
1 parent d4ba11a commit 9b515b6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,7 +2586,12 @@ void DAGTypeLegalizer::ExpandIntRes_FP_TO_UINT(SDNode *N, SDValue &Lo,
25862586

25872587
void DAGTypeLegalizer::ExpandIntRes_LLROUND_LLRINT(SDNode *N, SDValue &Lo,
25882588
SDValue &Hi) {
2589-
EVT VT = N->getOperand(0).getValueType().getSimpleVT().SimpleTy;
2589+
SDValue Op = N->getOperand(0);
2590+
2591+
assert(getTypeAction(Op.getValueType()) != TargetLowering::TypePromoteFloat &&
2592+
"Input type needs to be promoted!");
2593+
2594+
EVT VT = Op.getValueType();
25902595

25912596
RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
25922597
if (N->getOpcode() == ISD::LLROUND) {
@@ -2616,10 +2621,6 @@ void DAGTypeLegalizer::ExpandIntRes_LLROUND_LLRINT(SDNode *N, SDValue &Lo,
26162621
} else
26172622
llvm_unreachable("Unexpected opcode!");
26182623

2619-
SDValue Op = N->getOperand(0);
2620-
if (getTypeAction(Op.getValueType()) == TargetLowering::TypePromoteFloat)
2621-
Op = GetPromotedFloat(Op);
2622-
26232624
SDLoc dl(N);
26242625
EVT RetVT = N->getValueType(0);
26252626
TargetLowering::MakeLibCallOptions CallOptions;

0 commit comments

Comments
 (0)