From: Craig Topper Date: Thu, 6 Aug 2020 05:12:41 +0000 (-0700) Subject: [X86] Remove incomplete custom handling of i128 sdivrem/udivrem on Windows. X-Git-Tag: llvmorg-13-init~15605 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0215ae9735376ab527f32a68b2fcc9eb540f48c8;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 37097a1..729c420 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1929,8 +1929,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, setOperationAction(ISD::UDIV, MVT::i128, Custom); setOperationAction(ISD::SREM, MVT::i128, Custom); setOperationAction(ISD::UREM, MVT::i128, Custom); - setOperationAction(ISD::SDIVREM, MVT::i128, Custom); - setOperationAction(ISD::UDIVREM, MVT::i128, Custom); } // 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 case ISD::UDIV: isSigned = false; LC = RTLIB::UDIV_I128; break; case ISD::SREM: isSigned = true; LC = RTLIB::SREM_I128; break; case ISD::UREM: isSigned = false; LC = RTLIB::UREM_I128; break; - case ISD::SDIVREM: isSigned = true; LC = RTLIB::SDIVREM_I128; break; - case ISD::UDIVREM: isSigned = false; LC = RTLIB::UDIVREM_I128; break; } SDLoc dl(Op); @@ -29535,10 +29531,6 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N, return; } - LLVM_FALLTHROUGH; - } - case ISD::SDIVREM: - case ISD::UDIVREM: { SDValue V = LowerWin64_i128OP(SDValue(N,0), DAG); Results.push_back(V); return;