<div dir="ltr">Yeah, the function attributes section of LangRef is a reasonable place to put stuff like this:<div><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_LangRef.html-23function-2Dattributes&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=9SIQM2l9LBT0fy7gjw3gZ_JGUTA7MIRtzMSZmlqBtHI&s=R92M4dbBo9gOD8RfWBKDtYxbDkJFmKDuX_aVP3Wx5IE&e=">http://llvm.org/docs/LangRef.html#function-attributes</a></div><div><br></div><div>I think we should add this. I also know that LLILAC needs something like this as well. I propose the following:</div><div>- Add a string attribute called "stack-probe-symbol"="foo".</div><div>- The presence of this attribute indicates that stack probes should be emitted, even on non-Windows OSs.</div><div>- (future work) For LLILAC, if this attribute is present but the string is empty, this can be a signal that the check must be emitted inline, either as a sequence of stores or a loop.</div><div><br></div><div>This also addresses David's concern with the hardcoded __probestack symbol name.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 26, 2015 at 2:23 AM, John Kåre Alsaker <span dir="ltr"><<a href="mailto:john.mailinglists@gmail.com" target="_blank">john.mailinglists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since David Majnemer doesn't seem overly eager to merge my patches,<br>
let's see if we can't figure things out here.<br>
<br>
I noticed a string function attribute appeared in LangRef.rst, would<br>
that be the correct place to document this?<br>
<br>
For reference:<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9653&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=9SIQM2l9LBT0fy7gjw3gZ_JGUTA7MIRtzMSZmlqBtHI&s=gV_4pNmG2FALSPJQnNAjqjGyIRfdizkPb8iOmuKtSf8&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D9653</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9654&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=9SIQM2l9LBT0fy7gjw3gZ_JGUTA7MIRtzMSZmlqBtHI&s=FWQzb_lQwqWGOu9ERJCGtouQpV0sCATZiW3nESlX4hU&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D9654</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9858&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=9SIQM2l9LBT0fy7gjw3gZ_JGUTA7MIRtzMSZmlqBtHI&s=ceno8V9VFeBJBroOdwCco5sUIbSxH9vlZQoPnkGe9b8&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D9858</a><br>
<br>
On Wed, Aug 6, 2014 at 5:34 PM, John Kåre Alsaker<br>
<<a href="mailto:john.mailinglists@gmail.com">john.mailinglists@gmail.com</a>> wrote:<br>
> I updated <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D4717&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=9SIQM2l9LBT0fy7gjw3gZ_JGUTA7MIRtzMSZmlqBtHI&s=ibz-wRihBgpHNnNZPBdBfNEk9rzM_RKH_9aputdPTYA&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D4717</a> and also wrote an __probestack<br>
> implementation:<br>
> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Zoxc_compiler-2Drt_compare_llvm-2Dmirror-3Amaster...stprobe&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=9SIQM2l9LBT0fy7gjw3gZ_JGUTA7MIRtzMSZmlqBtHI&s=EzU7LhO9y-f1kS1q6Yr76NSnyLRtOQ7LJeFru3G9wDU&e=" rel="noreferrer" target="_blank">https://github.com/Zoxc/compiler-rt/compare/llvm-mirror:master...stprobe</a><br>
><br>
<span class="im HOEnZb">> Which instruction would be the preferable one to probe with? I used OR since<br>
> that's what GCC/libgcc does, but I don't see why that would be better than a<br>
> write.<br>
><br>
><br>
><br>
</span><span class="im HOEnZb">> On Tue, Aug 5, 2014 at 7:34 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
>><br>
>> On Tue, Aug 5, 2014 at 8:53 AM, John Kåre Alsaker<br>
</span><div class="HOEnZb"><div class="h5">>> <<a href="mailto:john.mailinglists@gmail.com">john.mailinglists@gmail.com</a>> wrote:<br>
>>><br>
>>> Would the __probestack functions be a suitable addition to compiler-rt?<br>
>>> Does it already have __chkstk or is that provided by something else on<br>
>>> Windows? I noticed that libgcc implemented them in cygwin.S.<br>
>><br>
>><br>
>> It seems reasonable to put them in compiler-rt/lib/builtins.<br>
>><br>
>> I don't think anyone is currently using compiler-rt's builtins on Windows,<br>
>> so it doesn't have __chkstk. Typically that is provided by the Cygwin,<br>
>> MinGW, or MSVC C runtime.<br>
><br>
><br>
</div></div></blockquote></div><br></div>