[llvm] [LV] Add support for partial reductions without a binary op (PR #133922)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 06:21:08 PDT 2025


================
@@ -281,31 +281,18 @@ bool VPRecipeBase::isPhi() const {
 InstructionCost
 VPPartialReductionRecipe::computeCost(ElementCount VF,
                                       VPCostContext &Ctx) const {
-  std::optional<unsigned> Opcode = std::nullopt;
-  VPValue *BinOp = getOperand(0);
+  // If the input operand is an extend then use the opcode for this recipe.
+  std::optional<unsigned> Opcode;
+  VPValue *Op = getOperand(0);
+  VPRecipeBase *OpR = Op->getDefiningRecipe();
 
   // If the partial reduction is predicated, a select will be operand 0 rather
   // than the binary op
----------------
david-arm wrote:

Done

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


More information about the llvm-commits mailing list