[PATCH] D145471: [RISCV] Set how many bytes load from or store to stack slot

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 18:43:55 PST 2023


kito-cheng added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:82
+                                             int &FrameIndex,
+                                             unsigned &MemBytes) const {
   switch (MI.getOpcode()) {
----------------
We might need to init MemByte to 0?

```
  /// Optional extension of isLoadFromStackSlot that returns the number of
  /// bytes loaded from the stack. This must be implemented if a backend
  /// supports partial stack slot spills/loads to further disambiguate
  /// what the load does.
  virtual unsigned isLoadFromStackSlot(const MachineInstr &MI, 
                                       int &FrameIndex,
                                       unsigned &MemBytes) const {
    MemBytes = 0; 
    return isLoadFromStackSlot(MI, FrameIndex);
  }

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145471



More information about the llvm-commits mailing list