[RISCV] Simplify eliminateFrameIndex in advance of reuse [nfc-ish]
authorPhilip Reames <preames@rivosinc.com>
Mon, 28 Nov 2022 17:26:21 +0000 (09:26 -0800)
committerPhilip Reames <listmail@philipreames.com>
Mon, 28 Nov 2022 18:09:37 +0000 (10:09 -0800)
commit5583972fe14e532c17d3d1a0607051e5adcbc7bb
tree2e6fdcba274e918685b62c14120948982dc1f7a6
parentf51170bffd507b872df228cb8c7512fe0389b7cf
[RISCV] Simplify eliminateFrameIndex in advance of reuse [nfc-ish]

The prior code intermixed several concerns - the actual materialization of the offset, the choice of destination register, and whether to prune the ADDI. This version factors the first part out, and then reasons only about the later two. My intention is to merge the adjustReg routine with the one from frame lowering, and then explore using the merged result to simplify frame setup and tear down.

This change is conceptually NFC, but since it results in slightly different vreg usage, the end result can change register allocation in minor ways.

Differential Revision: https://reviews.llvm.org/D138502
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
llvm/lib/Target/RISCV/RISCVRegisterInfo.h
llvm/test/CodeGen/RISCV/rvv/addi-scalable-offset.mir
llvm/test/CodeGen/RISCV/rvv/emergency-slot.mir