[all-commits] [llvm/llvm-project] 825ad8: [DAG] Fold nested add(add(reduce(a), b), add(reduc...

David Green via All-commits all-commits at lists.llvm.org
Tue Jun 24 05:09:20 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 825ad86aea5016f0466347862c8f6d23894ddc5a
      https://github.com/llvm/llvm-project/commit/825ad86aea5016f0466347862c8f6d23894ddc5a
  Author: David Green <david.green at arm.com>
  Date:   2025-06-24 (Tue, 24 Jun 2025)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AArch64/double_reduct.ll
    M llvm/test/CodeGen/Thumb2/mve-doublereduct.ll

  Log Message:
  -----------
  [DAG] Fold nested add(add(reduce(a), b), add(reduce(c), d)) (#115150)

This patch reassociates `add(add(vecreduce(a), b), add(vecreduce(c),
d))` into `add(vecreduce(add(a, c)), add(b, d))`, to combine the
reductions into a single node. This comes up after unrolling vectorized
loops.

There is another small change to move reassociateReduction inside fadd
outside of a AllowNewConst block, as new constants will not be created
and it should be OK to perform the combine later after legalization.



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