[PATCH] D18986: [ThinLTO] Prevent importing of "llvm.used" values

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 16:06:19 PDT 2016


joker.eph added a comment.

> > If you import `bar()` it mean you are not considering my 1) but the 2) above (this is a function that *contains* inline asm and not a function that is *referenced* by inline asm).

> 

> 

> I'm not following. When you said:

> 

> > 1. "llvm.used" symbols (that are referred *from* inline assembly)

> 

> 

> I assumed you meant the variable like @myvar which is on the llvm.used, and is referenced in the inline asm:

> 

> > @llvm.used = appending global [1 x i8*] [i8* @myvar], section "llvm.metadata"

> 

> 

> ...

> 

> >   call void asm sideeffect "movzbl     myvar(%rip), ...

> 

> 

> (In the example there is no function referenced by inline asm, just a variable.)

> 

> It is the llvm.used symbol myvar which cannot be correctly handled with a private alias, unless I am missing something. Maybe you could show what you are proposing using this example (i.e. the example in the patch augmented with an import to the additional module containing bar() shown above).


Let say `myvar` was instead `myfunc` and was referenced from the inline asm. And then let say you are trying to import `myfunc` into another module and you need to promote it. You should be able to rename `myfunc()` to `myfunc.1234()` and create a local alias `myfunc = alias myfunc.1234()`.
Makes sense?


http://reviews.llvm.org/D18986





More information about the llvm-commits mailing list