Skip to content

Commit 25286dd

Browse files
committed
Drop support for -Znew-llvm-pass-manager=no with LLVM 15
1 parent 57717eb commit 25286dd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+6
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,12 @@ pub(crate) unsafe fn optimize(
523523
let module_name = module.name.clone();
524524
let module_name = Some(&module_name[..]);
525525

526+
if let Some(false) = config.new_llvm_pass_manager && llvm_util::get_version() >= (15, 0, 0) {
527+
diag_handler.warn(
528+
"ignoring `-Z new-llvm-pass-manager=no`, which is no longer supported with LLVM 15",
529+
);
530+
}
531+
526532
if config.emit_no_opt_bc {
527533
let out = cgcx.output_filenames.temp_path_ext("no-opt.bc", module_name);
528534
let out = path_to_c_string(&out);

compiler/rustc_codegen_llvm/src/llvm_util.rs

+5
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ pub(crate) fn should_use_new_llvm_pass_manager(user_opt: &Option<bool>, target_a
542542
// The new pass manager is enabled by default for LLVM >= 13.
543543
// This matches Clang, which also enables it since Clang 13.
544544

545+
// Since LLVM 15, the legacy pass manager is no longer supported.
546+
if llvm_util::get_version() >= (15, 0, 0) {
547+
return true;
548+
}
549+
545550
// There are some perf issues with the new pass manager when targeting
546551
// s390x with LLVM 13, so enable the new pass manager only with LLVM 14.
547552
// See https://github.com/rust-lang/rust/issues/89609.

0 commit comments

Comments
 (0)