File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2074,7 +2074,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
20742074InstructionCost 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 ();
You can’t perform that action at this time.
0 commit comments