[RISCV] Reduce scalar load/store isel patterns to a single ComplexPattern. NFCI
authorCraig Topper <craig.topper@sifive.com>
Fri, 3 Jun 2022 05:08:51 +0000 (22:08 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 3 Jun 2022 16:00:17 +0000 (09:00 -0700)
commit440285200265eca0e148cb838f83fa7cbc37c640
treec38551c56375e226d13e052db819ae1b2c4dd233
parent3a252806f41b04da021de26111106f1a67f501a6
[RISCV] Reduce scalar load/store isel patterns to a single ComplexPattern. NFCI

Previously we had 3 different isel patterns for every scalar load
store instruction.

This reduces them to a single ComplexPattern that returns the Base
and Offset. Or an offset of 0 if there was no offset identified

I've done a similar thing for the 2 isel patterns that match add/or
with FrameIndex and immediate. Using the offset of 0, I was also
able to remove the custom handler for FrameIndex. Happy to split that
to another patch.

We might be able to enhance in the future to remove the post-isel
peephole or the special handling for ADD with constant added by D126576.

A nice side effect is that this removes nearly 3000 bytes from the isel
table.

Differential Revision: https://reviews.llvm.org/D126932
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/lib/Target/RISCV/RISCVInstrInfoA.td