[llvm] [AArch64] Reflect cost of integer sub-reductions. (PR #194594)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 03:18:51 PDT 2026


================
@@ -6110,14 +6111,9 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
       return Cost * 2;
   }
 
-  InstructionCost ExpandCost = BaseT::getPartialReductionCost(
-      Opcode, InputTypeA, InputTypeB, AccumType, VF, OpAExtend, OpBExtend,
-      BinOp, CostKind, FMF);
-
-  // Slightly lower the cost of a sub reduction so that it can be considered
-  // as candidate for 'cdot' operations. This is a somewhat arbitrary number,
-  // because we don't yet model these operations directly.
-  return ExpandCost.isValid() && IsSub ? ((8 * ExpandCost) / 10) : ExpandCost;
+  return BaseT::getPartialReductionCost(Opcode, InputTypeA, InputTypeB,
+                                        AccumType, VF, OpAExtend, OpBExtend,
----------------
huntergr-arm wrote:

Is this change covered by any tests? (Just wondering which part corresponds to the differences in the cost lines of the second test file).

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


More information about the llvm-commits mailing list