<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jan 4, 2018 at 12:55 PM Roger via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">royger added a comment.<br>
<br>
AFAICT this change doesn't allow to use different indirect thunks, gcc allows such usage with the -mindirect-branch=thunk-extern/-mindirect-branch-register options. The following patches for example allow Xen to choose the optimal thunk depending on the processor:<br>
<br>
<a href="https://lists.xenproject.org/archives/html/xen-devel/2018-01/msg00112.html" rel="noreferrer" target="_blank">https://lists.xenproject.org/archives/html/xen-devel/2018-01/msg00112.html</a><br>
<a href="https://lists.xenproject.org/archives/html/xen-devel/2018-01/msg00118.html" rel="noreferrer" target="_blank">https://lists.xenproject.org/archives/html/xen-devel/2018-01/msg00118.html</a></blockquote><div><br></div><div>While allowing external thunks seems useful for experimentation, I much prefer that we don't have to establish a precise API / ABI for the exact thunks. One advantage of the way we're handling this in LLVM is that the thunks are *completely* transparent and work cleanly even in dynamic executables.</div><div><br></div><div>Is there any benchmark data showing that the different thunk is superior on AMD processors? Any official AMD documentation we can cite here?</div><div><br></div><div>We can easily extend this code to generate custom thunks for specific processors -- we have that kind of information inside the compiler.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
<br>
<a href="https://reviews.llvm.org/D41723" rel="noreferrer" target="_blank">https://reviews.llvm.org/D41723</a><br>
<br>
<br>
<br>
</blockquote></div></div>