[DAGCombiner][SVE] Ensure MGATHER/MSCATTER addressing mode combines preserve index...
authorPaul Walker <paul.walker@arm.com>
Tue, 5 Apr 2022 16:49:01 +0000 (17:49 +0100)
committerPaul Walker <paul.walker@arm.com>
Fri, 29 Apr 2022 11:35:16 +0000 (12:35 +0100)
commit7a0b897e8664d11481230a69a88fca2b2ee5f904
tree09b8237d32a4d3bf2a90ab8554ea6f70d82d5811
parentcacaa445c3a3a2551a6e2aef51414e47def9cc06
[DAGCombiner][SVE] Ensure MGATHER/MSCATTER addressing mode combines preserve index scaling

refineUniformBase and selectGatherScatterAddrMode both attempt the
transformation:

  base(0) + index(A+splat(B)) => base(B) + index(A)

However, this is only safe when index is not implicitly scaled.

Differential Revision: https://reviews.llvm.org/D123222
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-gather-scatter-addr-opts.ll