summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-12-16 00:26:30 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-12-16 00:26:30 +0000
commit1398a32e2857bab844a3b4c9f6d2cbf7770471b3 (patch)
tree390ac3a30dbe4dc7cdb4ccdb6551e37daacde4fe /llvm/tools
parent1b48bac3300d440e6a2772f6feda40680d61729c (diff)
downloadbcm5719-llvm-1398a32e2857bab844a3b4c9f6d2cbf7770471b3.tar.gz
bcm5719-llvm-1398a32e2857bab844a3b4c9f6d2cbf7770471b3.zip
IPO: Introduce ThinLTOBitcodeWriter pass.
This pass prepares a module containing type metadata for ThinLTO by splitting it into regular and thin LTO parts if possible, and writing both parts to a multi-module bitcode file. Modules that do not contain type metadata are written unmodified as a single module. All globals with type metadata are added to the regular LTO module, and the rest are added to the thin LTO module. Differential Revision: https://reviews.llvm.org/D27324 llvm-svn: 289899
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/opt/opt.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 035629a8aa4..a93c06c1d13 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -99,6 +99,10 @@ static cl::opt<bool>
OutputAssembly("S", cl::desc("Write output as LLVM assembly"));
static cl::opt<bool>
+ OutputThinLTOBC("thinlto-bc",
+ cl::desc("Write output as ThinLTO-ready bitcode"));
+
+static cl::opt<bool>
NoVerify("disable-verify", cl::desc("Do not run the verifier"), cl::Hidden);
static cl::opt<bool>
@@ -704,7 +708,9 @@ int main(int argc, char **argv) {
if (EmitModuleHash)
report_fatal_error("Text output is incompatible with -module-hash");
Passes.add(createPrintModulePass(*OS, "", PreserveAssemblyUseListOrder));
- } else
+ } else if (OutputThinLTOBC)
+ Passes.add(createWriteThinLTOBitcodePass(*OS));
+ else
Passes.add(createBitcodeWriterPass(*OS, PreserveBitcodeUseListOrder,
EmitSummaryIndex, EmitModuleHash));
}
OpenPOWER on IntegriCloud