File tree 1 file changed +8
-1
lines changed
llvm/lib/Transforms/Vectorize
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) {
2025
2025
InstructionCost VPReductionRecipe::computeCost (ElementCount VF,
2026
2026
VPCostContext &Ctx) const {
2027
2027
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
+
2029
2036
auto *VectorTy = cast<VectorType>(ToVectorTy (ElementTy, VF));
2030
2037
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
2031
2038
unsigned Opcode = RdxDesc.getOpcode ();
You can’t perform that action at this time.
0 commit comments