[llvm] [AMDGPU] Fold saddsat(x, -C) to ssubsat(x, C) when C is an inline constant (PR #216592)
Madhur Kumar via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 16 14:19:06 PDT 2026
================
@@ -1029,14 +1033,35 @@ class OpSelBinOpClampPat<SDPatternOperator node,
let SubtargetPredicate = isGFX9Plus, True16Predicate = NotHasTrue16BitInsts in {
def : OpSelBinOpClampPat<saddsat, V_ADD_I16_e64>;
def : OpSelBinOpClampPat<ssubsat, V_SUB_I16_e64>;
+
+ let AddedComplexity = 15 in {
----------------
MadhurKumar004 wrote:
`def : OpSelBinOpClampPat<saddsat, V_ADD_I16_e64>; ` has complexity of 21, and now defined pattern had 7, so is it better to keep it JUST above 21 by adding complexity of 15 or it should have some margin?
https://github.com/llvm/llvm-project/pull/216592
More information about the llvm-commits
mailing list