Skip to content

Commit dc5b400

Browse files
committed
Address comments.
1 parent f2c2b8f commit dc5b400

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
@@ -2025,7 +2025,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
20252025
InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20262026
VPCostContext &Ctx) const {
20272027
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
2028-
Type *ElementTy = RdxDesc.getRecurrenceType();
2028+
// TODO: Support any-of reduction and in-loop reduction
2029+
assert(!RecurrenceDescriptor::isAnyOfRecurrenceKind(RdxKind) &&
2030+
"Not support any-of reduction in VPlan-based cost model currently.");
2031+
2032+
Type *ElementTy = Ctx.Types.inferScalarType(this->getVPSingleValue());
2033+
assert(ElementTy->getTypeID() == RdxDesc.getRecurrenceType()->getTypeID() &&
2034+
"Infered type and recurrence type mismatch.");
2035+
20292036
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20302037
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20312038
unsigned Opcode = RdxDesc.getOpcode();

0 commit comments

Comments
 (0)