[PATCH] D138926: [RISCV] Reuse and generalize adjustReg from another spot in frame lowering [nfc]

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 01:13:11 PST 2022


frasercrmck accepted this revision.
frasercrmck added a comment.
This revision is now accepted and ready to land.

LGTM (with nit) - I couldn't find or think of any problems arising from this.



================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:350
+  const RISCVRegisterInfo &RI = *STI.getRegisterInfo();
+  RI.adjustReg(MBB, MBBI, DL, SPReg, SPReg, StackOffset::getScalable(Amount),
+               Flag);
----------------
We have `RISCVFrameLowering::adjustReg` (used elsewhere in this file) which wraps the call to `RI.adjustReg`. I think we should continue to use use `adjustReg` (for now) even though they're equivalent.

Personally I'm not a huge fan of having identically-named methods across multiple files/classes. So if you wanted to remove `RISCVFrameLowering::adjustReg` and make everyone call the `RISCVRegisterInfo` one directly, I'd support that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138926/new/

https://reviews.llvm.org/D138926



More information about the llvm-commits mailing list