[DAG] Move one-use add of splat to base of scatter/gather
authorPhilip Reames <preames@rivosinc.com>
Fri, 23 Sep 2022 01:35:00 +0000 (18:35 -0700)
committerPhilip Reames <listmail@philipreames.com>
Fri, 23 Sep 2022 01:45:12 +0000 (18:45 -0700)
commitb9c473307954e62f5f756aa7af315d0ffe707634
treed14a34915a92003c1bdd48f266bba7d50faf4e51
parent95eb5109afa4c5d26a9432e01eb31dbfc16355c5
[DAG] Move one-use add of splat to base of scatter/gather

This extends the uniform base transform used with scatter/gather to support one-use vector adds-of-splats with a non-zero base. This has the effect of essentially reassociating an add from vector to scalar domain.

The motivation is to improve the lowering of scatter/gather operations fed by complex geps.

Differential Revision: https://reviews.llvm.org/D134472
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/sve-gather-scatter-addr-opts.ll
llvm/test/CodeGen/RISCV/rvv/mscatter-combine.ll