[llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 06:50:22 PDT 2025


================
@@ -3250,14 +3250,15 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
   }
 
   InstructionCost
-  getMulAccReductionCost(bool IsUnsigned, Type *ResTy, VectorType *Ty,
+  getMulAccReductionCost(bool IsUnsigned, unsigned RedOpcode, Type *ResTy,
+                         VectorType *Ty,
                          TTI::TargetCostKind CostKind) const override {
     // Without any native support, this is equivalent to the cost of
     // vecreduce.add(mul(ext(Ty A), ext(Ty B))) or
-    // vecreduce.add(mul(A, B)).
+    // vecreduce.add(mul(A, B)). IsNegated determines if the mul is negated.
----------------
sdesmalen-arm wrote:

`IsNegated` no longer exists.

please also add an assert that RedOpcode is either an add or a sub.

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


More information about the llvm-commits mailing list