[PATCH] D19102: Always traverse GlobalVariable initializer when computing the export list

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 12:05:44 PDT 2016


joker.eph added a comment.

In http://reviews.llvm.org/D19102#401545, @tejohnson wrote:

> > We are always importing the initializer for a GlobalVariable.
>
>
> I don't think this is true anymore, or at least I can't find where we are doing this. We used to always import variable defs in the Linker, but now that is being passed a list of globals to import.


We do it for every global that is referenced from the IR we import, this is done in `IRLinker::linkGlobalInit(GlobalVariable &Dst, GlobalVariable &Src)`.
(I couldn't find a reliable way to avoid this, too many corner cases).

> I think if we want to add handling like this for the future when variable defs are imported, a better place would be in computeImportForFunction where we would presumably walk the refs() and make those decisions (similar to how the ExportList is updated for callees in the loop over the call edges in that function.


That's was the plan when we moved to the "reference graph", however it seems to me that we're blocked on `IRLinker::linkGlobalInit(GlobalVariable &Dst, GlobalVariable &Src)` right now.

I'll update the comment mentionning that it is a current limitation of the IRMover.


http://reviews.llvm.org/D19102





More information about the llvm-commits mailing list