[clang] [llvm] [AMDGPU] Add dot product patterns with saturating add (clamp) (PR #187945)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 07:04:44 PDT 2026


================
@@ -16946,6 +16946,73 @@ SDValue SITargetLowering::performAddCombine(SDNode *N,
   return SDValue();
 }
 
+// Try to fold saturating add with dot product intrinsic into dot instruction
+// with clamp. Matches patterns like:
+// uaddsat(dot4(..., 0), c) -> dot4(..., c) clamp
+// uaddsat(dot2(..., 0), c) -> dot2(..., c) clamp
+SDValue SITargetLowering::performSatAddCombine(SDNode *N,
----------------
addmisol wrote:

Removed performSatAddCombine. The saturation patterns are already covered by:
  - visitSaturatingAdd in AMDGPUCodeGenPrepare for dot4 (handles uaddsat(reduce.add(mul(...)), c))
  - TableGen patterns UDot2SatPat/SDot2SatPat in VOP3PInstructions.td for dot2

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


More information about the cfe-commits mailing list