[PATCH] D26146: [ThinLTO] Prevent exporting of locals used/defined in module level asm

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 09:37:53 PST 2016


mehdi_amini added a comment.

In https://reviews.llvm.org/D26146#589387, @tejohnson wrote:

> In https://reviews.llvm.org/D26146#589364, @mehdi_amini wrote:
>
> > In https://reviews.llvm.org/D26146#589341, @tejohnson wrote:
> >
> > > In https://reviews.llvm.org/D26146#585633, @mehdi_amini wrote:
> > >
> > > > > Then the assumption works for this fix since it is only looking for static globals (i.e. local linkage), right? I can just update the description and possibly the code comment if that is the case
> > > >
> > > > The `attribute((used))` will makes use of the `@llvm.used`, which you already handled before this patch right?
> > >
> > >
> > > Right for llvm.used, but I was referring to static (local linkage) values in the llvm.compiler.used which is added in this patch, since you mentioned: "It does not apply to non-static I believe, and this is why are currently parsing the module inline ASM at LTO time and updating the llvm.compiler_used, because this is not something the FE is required to do."
> > >
> > > I read from that that any statics would have been placed by the FE in the llvm.compiler.used set, or is that not a correct interpretation? Going back to the email discussion I included in my earlier response, it seems that it must be true that "The frontend is responsible to add [local ref] @b to llvm.compiler_used", in which case the handling in this current patch that looks for locals in the llvm.compiler.used is correct, right?
> >
> >
> > To be more precise: the FE can put uses from inline ASM to static symbol in either llvm.used or llvm.compiler_used (i.e. the latter should be "enough").
>
>
> Only module-level asm, not "inline asm calls", which are opaque to the compiler and require a user attribute like:


This is not clear to my why?
It seems perfectly legit to me that a FE would generate inline ASM calls to a local function and add it to llvm.compiler_used and not llvm.used.


https://reviews.llvm.org/D26146





More information about the llvm-commits mailing list