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

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 1 07:22:37 PDT 2025


================
@@ -1468,8 +1468,8 @@ static void analyzeCostOfVecReduction(const IntrinsicInst &II,
                              TTI::CastContextHint::None, CostKind, RedOp);
 
     CostBeforeReduction = ExtCost * 2 + MulCost + Ext2Cost;
-    CostAfterReduction =
-        TTI.getMulAccReductionCost(IsUnsigned, II.getType(), ExtType, CostKind);
+    CostAfterReduction = TTI.getMulAccReductionCost(
+        IsUnsigned, ReductionOpc, II.getType(), ExtType, CostKind);
----------------
SamTebbs33 wrote:

I've been trying to make a test but I don't think this code is ever reached. The `RedOp && match(RedOp, m_ZExtOrSExt(m_Value()))` check above fully (AFAIK) encompasses this check so that code path is always followed instead. If I move this if statement block above that one above then the compiler fails the assertion at Type.cpp:805.

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


More information about the llvm-commits mailing list