aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorCharles Saternos <charles.saternos@gmail.com>2018-02-11 22:06:20 +0000
committerCharles Saternos <charles.saternos@gmail.com>2018-02-11 22:06:20 +0000
commitd3e7d19f5998822b229d8fdd633a53d101bd28d4 (patch)
treed8fdcd87f76617cd5a9c6c641e6d85d50aa347f9 /llvm/lib/LTO/LTO.cpp
parent2328c589f1b29804a246974f24cbaf7d7c1a55bd (diff)
downloadllvm-d3e7d19f5998822b229d8fdd633a53d101bd28d4.zip
llvm-d3e7d19f5998822b229d8fdd633a53d101bd28d4.tar.gz
llvm-d3e7d19f5998822b229d8fdd633a53d101bd28d4.tar.bz2
[ThinLTO] Add GraphTraits for FunctionSummaries
Add GraphTraits definitions to the FunctionSummary and ModuleSummaryIndex classes. These GraphTraits will be used to construct find SCC's in ThinLTO analysis passes. llvm-svn: 324854
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 1047b8d..94baee6 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -50,6 +50,10 @@ using namespace object;
#define DEBUG_TYPE "lto"
+static cl::opt<bool>
+ DumpThinCGSCCs("dump-thin-cg-sccs", cl::init(false), cl::Hidden,
+ cl::desc("Dump the SCCs in the ThinLTO index's callgraph"));
+
// The values are (type identifier, summary) pairs.
typedef DenseMap<
GlobalValue::GUID,
@@ -1141,6 +1145,9 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache) {
ThinLTO.ModuleMap.size());
StringMap<std::map<GlobalValue::GUID, GlobalValue::LinkageTypes>> ResolvedODR;
+ if (DumpThinCGSCCs)
+ ThinLTO.CombinedIndex.dumpSCCs(outs());
+
if (Conf.OptLevel > 0)
ComputeCrossModuleImport(ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
ImportLists, ExportLists);