Skip to content

Commit 4f2cc46

Browse files
committed
Address comments.
1 parent 91fcf39 commit 4f2cc46

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
20742074
InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20752075
VPCostContext &Ctx) const {
20762076
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
2077-
Type *ElementTy = RdxDesc.getRecurrenceType();
2077+
// TODO: Support any-of reduction and in-loop reduction
2078+
assert(!RecurrenceDescriptor::isAnyOfRecurrenceKind(RdxKind) &&
2079+
"Not support any-of reduction in VPlan-based cost model currently.");
2080+
2081+
Type *ElementTy = Ctx.Types.inferScalarType(this->getVPSingleValue());
2082+
assert(ElementTy->getTypeID() == RdxDesc.getRecurrenceType()->getTypeID() &&
2083+
"Infered type and recurrence type mismatch.");
2084+
20782085
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20792086
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20802087
unsigned Opcode = RdxDesc.getOpcode();

0 commit comments

Comments
 (0)