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 @@ -2025,7 +2025,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
20252025InstructionCost 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 ();
You can’t perform that action at this time.
0 commit comments