[all-commits] [llvm/llvm-project] f7b674: [LV] Allow AddChainWithSubs in ExtNegatedMulAccRed...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Jun 13 13:00:46 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f7b674930f468562b9e41481217ef4e1ed431e1b
      https://github.com/llvm/llvm-project/commit/f7b674930f468562b9e41481217ef4e1ed431e1b
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-06-13 (Sat, 13 Jun 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/test/Transforms/LoopVectorize/reduction-inloop.ll

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list