Skip to content

Commit f154622

Browse files
committed
Address comments.
1 parent 86140e0 commit f154622

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
@@ -2015,7 +2015,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
20152015
InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20162016
VPCostContext &Ctx) const {
20172017
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
2018-
Type *ElementTy = RdxDesc.getRecurrenceType();
2018+
// TODO: Support any-of reduction and in-loop reduction
2019+
assert(!RecurrenceDescriptor::isAnyOfRecurrenceKind(RdxKind) &&
2020+
"Not support any-of reduction in VPlan-based cost model currently.");
2021+
2022+
Type *ElementTy = Ctx.Types.inferScalarType(this->getVPSingleValue());
2023+
assert(ElementTy->getTypeID() == RdxDesc.getRecurrenceType()->getTypeID() &&
2024+
"Infered type and recurrence type mismatch.");
2025+
20192026
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20202027
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20212028
unsigned Opcode = RdxDesc.getOpcode();

0 commit comments

Comments
 (0)