[PATCH] D128188: [RISCV] Add a scavenge spill slot when use ADDI to compute scalable stack offset

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 08:50:51 PDT 2022


craig.topper added a comment.

Is it possible to add a test where we use the 2 slots for spills?



================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:962
+          // require up to one scratch register.
+          LocalMostScavSlotsNum = isScalableVectorID ? 2 : 1;
+        } else if (MI.getOpcode() == RISCV::ADDI) {
----------------
Why not use std::max here? Why separate local/global variable?


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:970
+      }
+      GlobalMostScavSlotsNum = std::max(GlobalMostScavSlotsNum, LocalMostScavSlotsNum);
+    }
----------------
Should we stop searching when `GlobalMostScavSlotsNum` becomes 2?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128188



More information about the llvm-commits mailing list