Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvisWang123 committed Oct 9, 2024
1 parent 86140e0 commit f154622
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
VPCostContext &Ctx) const {
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
Type *ElementTy = RdxDesc.getRecurrenceType();
// TODO: Support any-of reduction and in-loop reduction
assert(!RecurrenceDescriptor::isAnyOfRecurrenceKind(RdxKind) &&
"Not support any-of reduction in VPlan-based cost model currently.");

Type *ElementTy = Ctx.Types.inferScalarType(this->getVPSingleValue());
assert(ElementTy->getTypeID() == RdxDesc.getRecurrenceType()->getTypeID() &&
"Infered type and recurrence type mismatch.");

auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
unsigned Opcode = RdxDesc.getOpcode();
Expand Down

0 comments on commit f154622

Please sign in to comment.