[llvm] [AMDGPU] Select v_lshl_add_u32 instead of v_mul_lo_u32 by constant (PR #71035)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 01:28:26 PDT 2023


================
@@ -4080,6 +4080,17 @@ SDValue AMDGPUTargetLowering::performMulCombine(SDNode *N,
   SDValue N0 = N->getOperand(0);
   SDValue N1 = N->getOperand(1);
 
+  // FIXME: Probably should only be done for gfx9 and onward.
----------------
arsenm wrote:

Yes should check for gfx9-insts. We have these wrappers:

```
  bool hasSwap() const {
    return GFX9Insts;
  }

  bool hasScalarPackInsts() const {
    return GFX9Insts;
  }

  bool hasScalarMulHiInsts() const {
    return GFX9Insts;
  }


```

Should have another for the shl add 

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


More information about the llvm-commits mailing list