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 @@ -2015,7 +2015,14 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
2015
2015
InstructionCost VPReductionRecipe::computeCost (ElementCount VF,
2016
2016
VPCostContext &Ctx) const {
2017
2017
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
+
2019
2026
auto *VectorTy = cast<VectorType>(ToVectorTy (ElementTy, VF));
2020
2027
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
2021
2028
unsigned Opcode = RdxDesc.getOpcode ();
You can’t perform that action at this time.
0 commit comments