[llvm] [AMDGPU] Always lower s/udiv64 by constant to MUL (PR #100723)

Tim Gymnich via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 05:17:11 PDT 2024


================
@@ -6588,7 +6589,8 @@ SDValue TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG,
     if (VT.isVector())
       WideVT = EVT::getVectorVT(*DAG.getContext(), WideVT,
                                 VT.getVectorElementCount());
-    if (isOperationLegalOrCustom(ISD::MUL, WideVT)) {
+    if (isOperationLegalOrCustom(ISD::MUL, WideVT) ||
----------------
tgymnich wrote:

Would using `V_MUL_HI_U32` / `V_MUL_HI_S32` work?

https://www.amd.com/content/dam/amd/en/documents/instinct-tech-docs/instruction-set-architectures/amd-instinct-mi300-cdna3-instruction-set-architecture.pdf

https://github.com/llvm/llvm-project/pull/100723


More information about the llvm-commits mailing list