[PATCH] D40863: [AArch64][Darwin] Implement stack probing for static and dynamic stack objects

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 23:53:15 PST 2017


mstorsjo added a subscriber: compnerd.
mstorsjo added a comment.

In https://reviews.llvm.org/D40863#945847, @aemerson wrote:

> In https://reviews.llvm.org/D40863#945833, @MatzeB wrote:
>
> > It would be helpful to describe somewhere what exactly stack probing is. Maybe add more comments to emitStackProbe() and the commit message.
> >
> > Is it one of those situations where you have to touch the OS pages backing stack memory one after the other (instead of accidentally jumping across pages for big arrays)?
>
>
> Yes, that's correct. The default implementation I've created in https://reviews.llvm.org/D40857 in compiler-rt loads data in 4096 (=page size) byte intervals. This ensures that the stack guard page is always hit


Since aarch64 on darwin isn't exactly new, how did expanding the stack by more than 4096 bytes work prior to this patchset? Functions allocating more than 4096 bytes of stack space isn't exactly uncommon. Will darwin start requiring this if it detects an executable built by a new enough toolchain to support it?



================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:502
+
+  BuildMI(MBB, MBBI, DL, TII->get(AArch64::BL))
+      .addExternalSymbol(MF.createExternalSymbolName(Symbol))
----------------
In the implementation in D41131 (based on the one for Windows on ARM by @compnerd in rL207615), I check for CodeModel::Large as well, and do the function call via MOVaddrEXT and BLR for that case.


Repository:
  rL LLVM

https://reviews.llvm.org/D40863





More information about the llvm-commits mailing list