Skip to content

Commit 01f8b6c

Browse files
committed
Disable LLVM newPM by default
cc #91128
1 parent 8a48b37 commit 01f8b6c

File tree

1 file changed

+4
-8
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+4
-8
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -395,18 +395,14 @@ fn get_pgo_sample_use_path(config: &ModuleConfig) -> Option<CString> {
395395
}
396396

397397
pub(crate) fn should_use_new_llvm_pass_manager(
398-
cgcx: &CodegenContext<LlvmCodegenBackend>,
398+
_cgcx: &CodegenContext<LlvmCodegenBackend>,
399399
config: &ModuleConfig,
400400
) -> bool {
401-
// The new pass manager is enabled by default for LLVM >= 13.
402-
// This matches Clang, which also enables it since Clang 13.
403-
404-
// FIXME: There are some perf issues with the new pass manager
405-
// when targeting s390x, so it is temporarily disabled for that
406-
// arch, see https://github.com/rust-lang/rust/issues/89609
401+
// The new pass manager is causing significant performance issues such as #91128, and is
402+
// therefore disabled in stable versions of rustc by default.
407403
config
408404
.new_llvm_pass_manager
409-
.unwrap_or_else(|| cgcx.target_arch != "s390x" && llvm_util::get_version() >= (13, 0, 0))
405+
.unwrap_or(false)
410406
}
411407

412408
pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(

0 commit comments

Comments
 (0)