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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user