[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #147513)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 19 00:37:05 PST 2025
================
@@ -304,134 +303,6 @@ bool VPRecipeBase::isScalarCast() const {
return VPI && Instruction::isCast(VPI->getOpcode());
}
-InstructionCost
-VPPartialReductionRecipe::computeCost(ElementCount VF,
- VPCostContext &Ctx) const {
- std::optional<unsigned> Opcode;
- VPValue *Op = getVecOp();
- uint64_t MulConst;
-
- InstructionCost CondCost = 0;
- if (isConditional()) {
- CmpInst::Predicate Pred = CmpInst::BAD_ICMP_PREDICATE;
- auto *VecTy = Ctx.Types.inferScalarType(Op);
- auto *CondTy = Ctx.Types.inferScalarType(getCondOp());
- CondCost = Ctx.TTI.getCmpSelInstrCost(Instruction::Select, VecTy, CondTy,
- Pred, Ctx.CostKind);
- }
----------------
fhahn wrote:
Oh that’s surprising, are we forming partial reductions for those cases? If not than it would be good to check first why the behavior changed, because that would be somewhat unexpected. I think we also have the predicate cost on main, but maybe the difference would be that after moving we may already have and pass the correct vector types?
https://github.com/llvm/llvm-project/pull/147513
More information about the llvm-commits
mailing list