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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 08:19:27 PST 2015


On 18 December 2015 at 10:47, Joerg Sonnenberger via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> On Fri, Dec 18, 2015 at 05:50:38PM +0300, Dmitry Polukhin wrote:
>> On Fri, Dec 18, 2015 at 5:39 PM, 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?
>> >
>>
>> I think it is kind of hack and LLVM will have to know about ifunc in some
>> way to avoid optimizing such aliases (i.e. using resolver instead of ifunc
>> that it wrong). It is like using alias as ifunc but even not even mark it
>> as ifunc until target assembler :) But anyway it seems that it worth
>> mention so I'll put it into RFC as an option.
>
> But it can't know what function is called?

Note that that inline asm only sets the symbol type. You would still
need a GVs to actually create the symbol, so doing that way would have
all the problems of saying an ifunc is an GlobalAlias.

Cheers,
Rafael


More information about the llvm-commits mailing list