Skip to content

Commit 0318883

Browse files
committed
Make -Z new-llvm-pass-manager an Option<bool>
To allow it to have an LLVM version dependent default.
1 parent 50e1dc1 commit 0318883

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ fn get_pgo_use_path(config: &ModuleConfig) -> Option<CString> {
410410

411411
pub(crate) fn should_use_new_llvm_pass_manager(config: &ModuleConfig) -> bool {
412412
// The new pass manager is disabled by default.
413-
config.new_llvm_pass_manager
413+
config.new_llvm_pass_manager.unwrap_or(false)
414414
}
415415

416416
pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub struct ModuleConfig {
108108
pub vectorize_slp: bool,
109109
pub merge_functions: bool,
110110
pub inline_threshold: Option<u32>,
111-
pub new_llvm_pass_manager: bool,
111+
pub new_llvm_pass_manager: Option<bool>,
112112
pub emit_lifetime_markers: bool,
113113
}
114114

compiler/rustc_interface/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ fn test_debugging_options_tracking_hash() {
709709
tracked!(mir_emit_retag, true);
710710
tracked!(mir_opt_level, Some(4));
711711
tracked!(mutable_noalias, Some(true));
712-
tracked!(new_llvm_pass_manager, true);
712+
tracked!(new_llvm_pass_manager, Some(true));
713713
tracked!(no_codegen, true);
714714
tracked!(no_generate_arange_section, true);
715715
tracked!(no_link, true);

compiler/rustc_session/src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
11121112
"MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)"),
11131113
mutable_noalias: Option<bool> = (None, parse_opt_bool, [TRACKED],
11141114
"emit noalias metadata for mutable references (default: yes for LLVM >= 12, otherwise no)"),
1115-
new_llvm_pass_manager: bool = (false, parse_bool, [TRACKED],
1115+
new_llvm_pass_manager: Option<bool> = (None, parse_opt_bool, [TRACKED],
11161116
"use new LLVM pass manager (default: no)"),
11171117
nll_facts: bool = (false, parse_bool, [UNTRACKED],
11181118
"dump facts from NLL analysis into side files (default: no)"),

0 commit comments

Comments
 (0)