[llvm-branch-commits] [llvm] [AMDGPU][InstCombine] Fold constant add/sub into the dot accumulator (PR #225002)
Harrison Hao via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 21 07:07:58 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())
----------------
harrisonGPU wrote:
I initially wanted to use `m_False()` as well, but it does not exist in LLVM IR's PatternMatch API. :-)
https://github.com/llvm/llvm-project/pull/225002
More information about the llvm-branch-commits
mailing list