[llvm-branch-commits] [llvm] [AMDGPU][InstCombine] Fold constant add/sub into the dot accumulator (PR #225002)

Steffen Larsen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 21 06:03:22 PDT 2026


================
@@ -1968,6 +1968,44 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
     Result = scalbn(Result, Scale, RoundingMode::NearestTiesToEven);
     return IC.replaceInstUsesWith(II, ConstantFP::get(Src->getType(), Result));
   }
+  case Intrinsic::amdgcn_sdot2:
+  case Intrinsic::amdgcn_udot2:
+  case Intrinsic::amdgcn_sdot4:
+  case Intrinsic::amdgcn_udot4:
+  case Intrinsic::amdgcn_sdot8:
+  case Intrinsic::amdgcn_udot8: {
+    if (!match(II.getArgOperand(3), m_Zero()) || !II.hasOneUse())
----------------
steffenlarsen wrote:

Nit; Could we use `m_False()` instead of `m_Zero()` here? Makes it clearer what we are looking for, even if they are effectively the same.

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


More information about the llvm-branch-commits mailing list