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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 16:10:01 PDT 2016


tejohnson added a comment.

In http://reviews.llvm.org/D18986#405716, @joker.eph wrote:

> I just noticed that I didn't approve the rev, I thought I did yesterday *before* all this discussion. To be clear I was not saying we need the fine grain now, I was just clarifying that it is "big hammer" and what can be done later.


Great. thanks.

> 

> 

> > > > Preventing the import of these function can be done using a "flag" in the summary (part of the flags we already talked about, i.e. optnone, optsize, etc.).

> 

> > 

> 

> > > 

> 

> > 

> 

> > 

> 

> > To get the finer-grained solution to work, we need to add this indication to the summary, and prevent importing of those functions. Then on the exporting side we need to add an alias to the old name for anything in the llvm.used set (even if we don't export any functions with inline assembly, a reference in another function could be exported, requiring the promotion).

> 

> 

> Yes, this is what I had in mind.

> 

> What needs to be added also is that there is an issue to import *into* a Module with llvm-used in some cases because of name collision:

> 

> Module A:  internal foo()    (<- referenced in llvm.used

>  Module B: void foo()

> 

> And now you want to import foo() from B into A?

>  Another case to forbid...


The current patch prevents importing into A because A will not have a summary index. But with a finer grain approach we will need to explicitly prevent this.

I will add a FIXME comment to the code before I submit to summarize the changes needed for a finer grain fix.


http://reviews.llvm.org/D18986





More information about the llvm-commits mailing list