Skip to content

Commit 0215ae9

Browse files
committed
[X86] Remove incomplete custom handling of i128 sdivrem/udivrem on Windows.
We need to have special handling of i128 div/rem on Windows due to a weird calling convention needed for the libcall. There was also some code that made it look like we do the same for sdivrem/udiv, but the code didn't account for multiple return values of those functions so couldn't possibly work. I think this code never triggers because we don't have libcall names defined for those functions by default so DAGCombine never creates DIVREM nodes.
1 parent bac1a08 commit 0215ae9

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,8 +1929,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
19291929
setOperationAction(ISD::UDIV, MVT::i128, Custom);
19301930
setOperationAction(ISD::SREM, MVT::i128, Custom);
19311931
setOperationAction(ISD::UREM, MVT::i128, Custom);
1932-
setOperationAction(ISD::SDIVREM, MVT::i128, Custom);
1933-
setOperationAction(ISD::UDIVREM, MVT::i128, Custom);
19341932
}
19351933

19361934
// On 32 bit MSVC, `fmodf(f32)` is not defined - only `fmod(f64)`
@@ -26899,8 +26897,6 @@ SDValue X86TargetLowering::LowerWin64_i128OP(SDValue Op, SelectionDAG &DAG) cons
2689926897
case ISD::UDIV: isSigned = false; LC = RTLIB::UDIV_I128; break;
2690026898
case ISD::SREM: isSigned = true; LC = RTLIB::SREM_I128; break;
2690126899
case ISD::UREM: isSigned = false; LC = RTLIB::UREM_I128; break;
26902-
case ISD::SDIVREM: isSigned = true; LC = RTLIB::SDIVREM_I128; break;
26903-
case ISD::UDIVREM: isSigned = false; LC = RTLIB::UDIVREM_I128; break;
2690426900
}
2690526901

2690626902
SDLoc dl(Op);
@@ -29535,10 +29531,6 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
2953529531
return;
2953629532
}
2953729533

29538-
LLVM_FALLTHROUGH;
29539-
}
29540-
case ISD::SDIVREM:
29541-
case ISD::UDIVREM: {
2954229534
SDValue V = LowerWin64_i128OP(SDValue(N,0), DAG);
2954329535
Results.push_back(V);
2954429536
return;

0 commit comments

Comments
 (0)