<div dir="ltr">On the other hand, CSR_AArch64_TLS_ELF isn't actually used, because AArch64 ELF TLS calls need to use a special call sequence in order for linker optimization magic to work.<div><br></div><div>I don't think anyone's said yet, what is the reason for wanting an exposed-to-the-IR calling convention for the TLS entrypoint? All of the llvm targets special case the TLS stuff anyhow -- which seems probably a good thing, since for so many archs it really *is* a weird special case, and not at all just a different function call convention.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 5:11 PM, Manman Ren <span dir="ltr"><<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Dec 4, 2015 at 2:05 PM, James Y Knight <span dir="ltr"><<a href="mailto:jyknight@google.com" target="_blank">jyknight@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Dec 4, 2015, at 4:44 PM, Joerg Sonnenberger via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
> On Fri, Dec 04, 2015 at 04:35:14PM -0500, James Y Knight wrote:<br>
>> On Dec 4, 2015, at 2:32 PM, Joerg Sonnenberger via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>>> On Fri, Dec 04, 2015 at 05:40:13PM -0000, Manman Ren via llvm-commits wrote:<br>
>>>> Author: mren<br>
>>>> Date: Fri DecĀ  4 11:40:13 2015<br>
>>>> New Revision: 254737<br>
>>>><br>
>>>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=254737&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=254737&view=rev</a><br>
>>>> Log:<br>
>>>> [CXX TLS calling convention] Add CXX TLS calling convention.<br>
>>><br>
>>> What the motivation for this? Is there any ABI documentation for it?<br>
>><br>
>><br>
>> This seems very much like an x86_64-Darwin specific calling convention,<br>
>> which is masquerading as a generic calling convention. Why not call it<br>
>> what it actually is, instead of pretending it's something generically useful?<br>
><br>
> I'm not sure if it is Darwin-specific, but one of the things I wonder<br>
> about is the "CXX" part in the name. If it is for use by dynamic TLS<br>
> initialisers, there is nothing C++ specific about it.<br>
<br>
<br>
</span>It seems to me darwin-specific, because the stated reason for adding it is that Darwin has pre-existing functions using this particular calling convention. It's otherwise exactly the same intent as preserve_mostcc, right? (The difference being that on x86_64, this preserves all GPRs except RAX and RDI, and preserve_most preserves all GPRs except R11).</blockquote><div><br></div></div></div><div>ELF also has its own C-style implementation, which can be different from preserve_most.<br></div><div>I saw CSR_AArch64_TLS_ELF in AArch64CallingConvention.td.</div><div><br></div><div>I don't see any precedence of putting a platform name in the name of a calling convention, it is either language specific or target specific.</div><div>(it may exist, but I didn't notice :)</div></div><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Manman</div></div>
</blockquote></div><br></div>