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

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 01:41:34 PDT 2021


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

LGTM.



================
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:
> 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)
I think it is fine with this patch.


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