[PATCH] D34387: [PATCH 2/2] Implement "probe-stack" on x86

Patrick Walton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 17:36:51 PDT 2017


pcwalton added a comment.

In https://reviews.llvm.org/D34387#785802, @whitequark wrote:

> @pcwalton No, both the spill and the "magic" number are necessary. See https://reviews.llvm.org/D9858. ebx is the size of the frame, and 0x1000 is the probe interval to be performed (in other words, page size).


That patch never landed, and the current approach, with customizable symbol names, is to move the responsibility out of compiler-rt. So I would argue that https://reviews.llvm.org/D9858 is irrelevant.



================
Comment at: lib/Target/X86/X86FrameLowering.cpp:1243-1245
+    // In the large code model, we have to load the stack probe function into a scratch
+    // register to call it. R11 is used for that.
+    bool SpillR11 = Is64Bit && MF.getTarget().getCodeModel() == CodeModel::Large;
----------------
majnemer wrote:
> Am I correct in thinking that we will save and restore R11 when we previously would not in the large code model for Win64? If so, was that a bug in the implementation of the large code model for Win64?
I'm not familiar enough with the Windows 64-bit ABI to be able to answer that question. I would assume that it would have to have been a bug in the previous implementation, as I don't see any other way to make the call to `__chkstk` work…


https://reviews.llvm.org/D34387





More information about the llvm-commits mailing list