[PATCH] D15525: [GCC] Attribute ifunc support in llvm

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 09:53:25 PST 2016


On Fri, Dec 18, 2015 at 6:39 AM, Joerg Sonnenberger via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Fri, Dec 18, 2015 at 09:17:17AM +0000, Dmitry Polukhin via llvm-commits
> wrote:
> > Just for the sake of completeness, there is a way to avoid IR extension
> > - it is possible to emit global asm statement like
> >    `__asm__ (".type resolver_alias_name, @gnu_indirect_function")`
> > and avoid IR extension but I didn't seriously consider this path.
>
> Why not? Let me put it another way: what is the advantage of making the
> intermediate layers aware of ifuncs? Can they provide better
> optimisations? Can they diagnose any potential bugs?


One possible optimization:

say you have a target specific function that calls a generic function that
in turn calls an ifunc function
with ifunc as a first-class construct you can potentially inline both calls
into the target specific outer function - inline the generic one, and in
doing so, observe that the resolver function would produce a constant
result (would have to teach the inliner about a cpuid intrinsic of some
sort) & thus lower the call-to-ifunc with a direct call, then inline that
call, etc.

- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160111/dde112dd/attachment.html>


More information about the llvm-commits mailing list