diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-04-04 18:52:23 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-04-04 18:52:23 +0000 |
commit | 0beb858e979602ce33c7298da9d2ae02aa2d69ad (patch) | |
tree | 677e2ef298bac65fc8d2fd1d0644c8a600f09378 /llvm/lib/Transforms/IPO/FunctionImport.cpp | |
parent | c293a2688de091bb269f160ebab67b446762bc1b (diff) | |
download | bcm5719-llvm-0beb858e979602ce33c7298da9d2ae02aa2d69ad.tar.gz bcm5719-llvm-0beb858e979602ce33c7298da9d2ae02aa2d69ad.zip |
[ThinLTO] Augment FunctionImport dump with value name to GUID map
Summary:
To aid in debugging, dump out the correlation between value names and
GUID for each source module when it is materialized. This will make it
easier to comprehend the earlier summary-based function importing debug
trace which only has access to and prints the GUIDs.
Reviewers: joker.eph
Subscribers: llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18556
llvm-svn: 265326
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index f69bc1dba59..a1d36de214e 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -320,7 +320,14 @@ bool FunctionImporter::importFunctions( // Find the globals to import DenseSet<const GlobalValue *> GlobalsToImport; for (auto &GV : *SrcModule) { - if (GV.hasName() && ImportGUIDs.count(GV.getGUID())) { + if (!GV.hasName()) + continue; + auto GUID = GV.getGUID(); + auto Import = ImportGUIDs.count(GUID); + DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing " << GUID << " " + << GV.getName() << " from " << SrcModule->getSourceFileName() + << "\n"); + if (Import) { GV.materialize(); GlobalsToImport.insert(&GV); } @@ -329,7 +336,11 @@ bool FunctionImporter::importFunctions( if (!GV.hasName()) continue; auto GUID = GV.getGUID(); - if (ImportGUIDs.count(GUID)) { + auto Import = ImportGUIDs.count(GUID); + DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing " << GUID << " " + << GV.getName() << " from " << SrcModule->getSourceFileName() + << "\n"); + if (Import) { // Alias can't point to "available_externally". However when we import // linkOnceODR the linkage does not change. So we import the alias // and aliasee only in this case. @@ -345,7 +356,11 @@ bool FunctionImporter::importFunctions( if (!GV.hasName()) continue; auto GUID = GV.getGUID(); - if (ImportGUIDs.count(GUID)) { + auto Import = ImportGUIDs.count(GUID); + DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing " << GUID << " " + << GV.getName() << " from " << SrcModule->getSourceFileName() + << "\n"); + if (Import) { GV.materialize(); GlobalsToImport.insert(&GV); } |