auto *VecTy = FixedVectorType::get(ScalarTy, ReduxWidth);
RecurKind Kind = RdxTreeInst.getKind();
+ unsigned RdxOpcode = RecurrenceDescriptor::getOpcode(Kind);
int SplittingRdxCost;
switch (Kind) {
case RecurKind::Add:
case RecurKind::Xor:
case RecurKind::FAdd:
case RecurKind::FMul:
- SplittingRdxCost =
- TTI->getArithmeticReductionCost(RdxTreeInst.getOpcode(), VecTy,
- /*IsPairwiseForm=*/false);
+ SplittingRdxCost = TTI->getArithmeticReductionCost(
+ RdxOpcode, VecTy, /*IsPairwiseForm=*/false);
break;
case RecurKind::SMax:
case RecurKind::SMin:
case RecurKind::Xor:
case RecurKind::FAdd:
case RecurKind::FMul:
- ScalarReduxCost =
- TTI->getArithmeticInstrCost(RdxTreeInst.getOpcode(), ScalarTy);
+ ScalarReduxCost = TTI->getArithmeticInstrCost(RdxOpcode, ScalarTy);
break;
case RecurKind::SMax:
case RecurKind::SMin:
case RecurKind::UMax:
case RecurKind::UMin:
ScalarReduxCost =
- TTI->getCmpSelInstrCost(RdxTreeInst.getOpcode(), ScalarTy) +
+ TTI->getCmpSelInstrCost(RdxOpcode, ScalarTy) +
TTI->getCmpSelInstrCost(Instruction::Select, ScalarTy,
CmpInst::makeCmpResultType(ScalarTy));
break;