[PATCH] D21943: Add 'thin_lto_imported' metadata to imported function

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 2 08:53:15 PDT 2016


Prazek added inline comments.

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:597
@@ +596,3 @@
+                      llvm::MDNode::get(DestModule.getContext(),
+                                        llvm::ArrayRef<llvm::Metadata *>()));
+        GlobalsToImport.insert(&F);
----------------
tejohnson wrote:
> Prazek wrote:
> > tejohnson wrote:
> > > eraman wrote:
> > > > It will be more useful to name this something like thin_lto_src_module and attach the source module's name.  
> > > I like the module name idea as well. We'd want to ensure that the module name MDString is uniqued though.
> > tl;dr I don't think there is problem with that. 
> > 
> > do we really need to ensure that? In the worst case we will merge 2 the same nodes into one and we will not be able to distinguish one from another, but is there any way to make a unique name, that is readable to human?
> > 
> > There are also 'distinct' nodes, but I am not sure if we should use that.
> I just meant that we don't want to have N copies of a full module name if we have N imports from that module. So hopefully it could be done in a way that each unique module name was an MDString and its metadata id would be referenced by the thin_lto_src_module metadata on the N imported functions.
oh yes, of course. 


Repository:
  rL LLVM

http://reviews.llvm.org/D21943





More information about the llvm-commits mailing list