@@ -2869,15 +2869,16 @@ InstructionCost VPExpressionRecipe::computeCost(ElementCount VF,
28692869 unsigned Opcode = RecurrenceDescriptor::getOpcode (
28702870 cast<VPReductionRecipe>(ExpressionRecipes[1 ])->getRecurrenceKind ());
28712871 auto *ExtR = cast<VPWidenCastRecipe>(ExpressionRecipes[0 ]);
2872- if (isa<VPPartialReductionRecipe>(ExpressionRecipes.back ())) {
2873- return Ctx.TTI .getPartialReductionCost (
2874- Opcode, Ctx.Types .inferScalarType (getOperand (0 )), nullptr , RedTy, VF,
2875- TargetTransformInfo::getPartialReductionExtendKind (ExtR->getOpcode ()),
2876- TargetTransformInfo::PR_None, std::nullopt , Ctx.CostKind );
2877- }
2878- return Ctx.TTI .getExtendedReductionCost (
2879- Opcode, ExtR->getOpcode () == Instruction::ZExt, RedTy, SrcVecTy,
2880- std::nullopt , Ctx.CostKind );
2872+ return isa<VPPartialReductionRecipe>(ExpressionRecipes.back ())
2873+ ? Ctx.TTI .getPartialReductionCost (
2874+ Opcode, Ctx.Types .inferScalarType (getOperand (0 )), nullptr ,
2875+ RedTy, VF,
2876+ TargetTransformInfo::getPartialReductionExtendKind (
2877+ ExtR->getOpcode ()),
2878+ TargetTransformInfo::PR_None, std::nullopt , Ctx.CostKind )
2879+ : Ctx.TTI .getExtendedReductionCost (
2880+ Opcode, ExtR->getOpcode () == Instruction::ZExt, RedTy,
2881+ SrcVecTy, std::nullopt , Ctx.CostKind );
28812882 }
28822883 case ExpressionTypes::MulAccReduction:
28832884 return Ctx.TTI .getMulAccReductionCost (false , Opcode, RedTy, SrcVecTy,
0 commit comments