[RISCV] Extend strided load/store pattern matching to non-loop cases
authorPhilip Reames <preames@rivosinc.com>
Tue, 27 Sep 2022 19:49:05 +0000 (12:49 -0700)
committerPhilip Reames <listmail@philipreames.com>
Tue, 27 Sep 2022 19:56:58 +0000 (12:56 -0700)
commitb54c571a01a4d07494d76f13889e47bc0c01ae2d
treea12e574881c0d52b144dcb39927bf86aa7226a1f
parentc0779756a0c4cc84d9f98714734d47879701cc3d
[RISCV] Extend strided load/store pattern matching to non-loop cases

The motivation here is to enable a change I'm exploring in vectorizer to prefer base + offset_vector addressing for scatter/gather. The form the vectorizer would end up emitting would be a gep whose vector operand is an add of the scalar IV (splated) and the index vector. This change makes sure we can recognize that pattern as well as the current code structure. As a side effect, it might improve scatter/gathers from other sources.

Differential Revision: https://reviews.llvm.org/D134755
llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
llvm/test/CodeGen/RISCV/rvv/mscatter-combine.ll