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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 06:07:07 PDT 2024


================
@@ -6405,7 +6405,8 @@ SDValue TargetLowering::BuildSDIV(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) ||
----------------
arsenm wrote:

> Why is the TLI hook not desirable?

Because we already have way too many garbage single use, undiscoverable hacks for specific combines like this one. 

> We already have some for other expansions.

That's the problem. They're all hacky shortcuts to avoid touching all the targets or coming up with a reasonable heuristic in terms of the existing APIs 

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


More information about the llvm-commits mailing list