Skip to content

Commit 1f949e9

Browse files
committed
Auto merge of #86020 - nagisa:nagisa/outliner, r=pnkfelix
Disable the machine outliner by default This addresses a codegen-issue that needs to be fixed upstream in LLVM. While we wait for the fix, we can disable it. Verified manually that the outliner is no longer run when `-Copt-level=z` is specified, and also that you can override this with `-Cllvm-args=-enable-machine-outliner` if you need it anyway. A regression test is not really feasible in this instance, given that we do not have any minimal reproducers. Fixes #85351 cc `@pnkfelix`
2 parents 40c1623 + c63a1c0 commit 1f949e9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::back::write::create_informational_target_machine;
2-
use crate::llvm;
2+
use crate::{llvm, llvm_util};
33
use libc::c_int;
44
use rustc_codegen_ssa::target_features::supported_target_features;
55
use rustc_data_structures::fx::FxHashSet;
@@ -84,6 +84,17 @@ unsafe fn configure_llvm(sess: &Session) {
8484
if !sess.opts.debugging_opts.no_generate_arange_section {
8585
add("-generate-arange-section", false);
8686
}
87+
88+
// FIXME(nagisa): disable the machine outliner by default in LLVM versions 11, where it was
89+
// introduced and up.
90+
//
91+
// This should remain in place until https://reviews.llvm.org/D103167 is fixed. If LLVM
92+
// has been upgraded since, consider adjusting the version check below to contain an upper
93+
// bound.
94+
if llvm_util::get_version() >= (11, 0, 0) {
95+
add("-enable-machine-outliner=never", false);
96+
}
97+
8798
match sess.opts.debugging_opts.merge_functions.unwrap_or(sess.target.merge_functions) {
8899
MergeFunctions::Disabled | MergeFunctions::Trampolines => {}
89100
MergeFunctions::Aliases => {

0 commit comments

Comments
 (0)