================ @@ -2861,12 +2861,17 @@ InstructionCost VPExpressionRecipe::computeCost(ElementCount VF, return Ctx.TTI.getMulAccReductionCost(false, Opcode, RedTy, SrcVecTy, Ctx.CostKind); - case ExpressionTypes::ExtMulAccReduction: + case ExpressionTypes::ExtNegatedMulAccReduction: + case ExpressionTypes::ExtMulAccReduction: { + if (ExpressionType == ExpressionTypes::ExtNegatedMulAccReduction && + Opcode == Instruction::Add) + Opcode = Instruction::Sub; ---------------- sdesmalen-arm wrote:
Does it ever happen that `Opcode != Instruction::Add`? If not, this should be written as: ```suggestion case ExpressionTypes::ExtNegatedMulAccReduction: assert(Opcode == Instruction::Add && "Unexpected opcode"); Opcode = Instruction::Sub; LLVM_FALLTHROUGH; case ExpressionTypes::ExtMulAccReduction: ``` https://github.com/llvm/llvm-project/pull/160154 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits