diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-12-21 07:03:16 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-12-23 16:04:15 -0800 |
| commit | b5361d0d41871874926bd489b8dc014a016c3f52 (patch) | |
| tree | a770c90135b8d67b3ab73e657c7288f434cf1d33 /src/rustllvm/PassWrapper.cpp | |
| parent | de38f49528b537414385d42a66dda711c8c8a309 (diff) | |
| download | rust-b5361d0d41871874926bd489b8dc014a016c3f52.tar.gz rust-b5361d0d41871874926bd489b8dc014a016c3f52.zip | |
rustc: Set release mode cgus to 16 by default
This commit is the next attempt to enable multiple codegen units by default in release mode, getting some of those sweet, sweet parallelism wins by running codegen in parallel. Performance should not be lost due to ThinLTO being on by default as well. Closes #45320
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 776e4a3e65a..4e326c9e199 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -1182,6 +1182,15 @@ LLVMRustThinLTOPatchDICompileUnit(LLVMModuleRef Mod, DICompileUnit *Unit) { MD->addOperand(Unit); } +extern "C" void +LLVMRustThinLTORemoveAvailableExternally(LLVMModuleRef Mod) { + Module *M = unwrap(Mod); + for (Function &F : M->functions()) { + if (F.hasAvailableExternallyLinkage()) + F.deleteBody(); + } +} + #else extern "C" bool @@ -1272,4 +1281,10 @@ extern "C" void LLVMRustThinLTOPatchDICompileUnit(LLVMModuleRef Mod) { report_fatal_error("ThinLTO not available"); } + +extern "C" void +LLVMRustThinLTORemoveAvailableExternally(LLVMModuleRef Mod) { + report_fatal_error("ThinLTO not available"); +} + #endif // LLVM_VERSION_GE(4, 0) |
