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