llvm-project
f7b67493 - [LV] Allow AddChainWithSubs in ExtNegatedMulAccReduction. (#203720)

Commit
119 days ago
[LV] Allow AddChainWithSubs in ExtNegatedMulAccReduction. (#203720) For chained reductions identified as RecurKind::AddChainWithSubs, VPlan construction rewrites each sub link as 0 - X so that the in-loop reduction can treat the chain uniformly as a sum. The ExtNegatedMulAccReduction VPExpressionRecipe matches that 0 - mul form, but its constructor only allowed RecurKind::Add and asserted otherwise, crashing with -prefer-inloop-reductions on the added tests. AddChainWithSubs maps to Instruction::Add via RecurrenceDescriptor::getOpcode, so the rest of the recipe (cost computation, codegen) already handles it. Relax the constructor assert to also accept AddChainWithSubs.
Author
Parents
Loading