<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 9, 2015 at 2:13 AM, Joerg Sonnenberger via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Dec 08, 2015 at 01:00:47PM -0800, David Blaikie wrote:<br>
> > This kind of logic sounds to be exactly like the<br>
> > thing an application should be controlling.<br>
> ><br>
><br>
> That's an option - if we surface the raw ifunc stuff, which I imagine we<br>
> would first before implementing the higher level function multiversioning.<br>
<br>
</span>ifunc again is a non-portable feature...<br></blockquote><div><br>Sure - but one that some users on platforms where it's available might want to use. LLVM certainly isn't limited to implementing only a portable subset of functionality available on all our current targets.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> But I'm not sure it adds a lot of value to have the application write that<br>
> code - but sure, could take a bit of a survey and see if function<br>
> multiversioning is used much/worth the compiler implementation complexity<br>
> over just implementing ifunc and letting the user figure it out from there.<br>
<br>
</span>Most libraries that care just have function pointers they call and<br>
initialise to the appropiate version. That's how they have been using<br>
optimised assembler versions for specific targets for ages. I don't see<br>
how this is different.</blockquote><div><br></div><div>Well, ifunc means potentially reduced call overhead since it's no longer an indirect call at least.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> More importantly, it gives users/developers<br>
control over what happens, which is surprisingly often an issue.</blockquote><div><br></div><div>Sure, and none of these features would remove the users ability to drop down to lower levels (multiversioning -> raw ifunc -> raw target attribute/manual dispatch).<br><br>- Dave </div></div></div></div>