[PATCH] D100574: [RISCV] Fix missing emergency slots for scalable stack offsets

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 01:00:12 PDT 2021


frasercrmck marked 2 inline comments as done.
frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:863
+    // For RVV, scalable stack offsets require up to two scratch registers to
+    // compute the final offset. Reserve an additional emergency spill slot.
+    if (RVVStackSize != 0) {
----------------
frasercrmck wrote:
> HsiangKai wrote:
> > What if `!isInt<11>(MFI.estimateStackSize(MF))` and `RVVStackSize != 0` occurred in the same function, do we need three or two emergency spill slot in total?
> I had assumed the worst case would still be two, but I'll run some tests.
In my simple testing, when both are true it's still two slots. I don't know if there's a more targeted test we can use for that (e.g. if fp vs sp would change things)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100574



More information about the llvm-commits mailing list