[PATCH] D96004: [AArch64] Stack probing for function prologues

Josh Stone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 09:48:10 PDT 2022


cuviper added inline comments.
Herald added a project: All.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:1382
+  if (TLI.hasInlineStackProbe(MF) && AllocateAfter) {
+    Register ScratchReg = findScratchNonCalleeSaveRegister(&MBB);
+    assert(ScratchReg != AArch64::NoRegister);
----------------
nagisa wrote:
> kristof.beyls wrote:
> > This line of code reminds me that frame setup can also happen in non-entry basic blocks, when shrink wrapping has happened.
> > Assuming I checked correctly, there are no test cases in the tests in this patch verifying correct behavior in case shrink wrapping happens. I'm not sure if it's worthwhile to have such tests, but I thought I'd check if you thought about this.
> I believe this would fail or produce incorrect results for functions that both have the `no_caller_saved_registers` attribute and request the inline stack probes, right?
> This line of code reminds me that frame setup can also happen in non-entry basic blocks, when shrink wrapping has happened.

FWIW, `TargetFrameLowering::canUseAsPrologue` can be used to block that if needed.
(I just used that to fix an X86 bug where stack probes clobbered EFLAGS, D134494.)




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96004



More information about the llvm-commits mailing list