From ce3d508f507949b2eec552237b540c129be3bc98 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Wed, 24 Nov 2021 21:13:53 +0200 Subject: [PATCH] Disable LLVM newPM by default cc #91128 --- compiler/rustc_codegen_llvm/src/back/write.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 3d05fc15b38f4..6d2ad70af276c 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -395,18 +395,14 @@ fn get_pgo_sample_use_path(config: &ModuleConfig) -> Option { } pub(crate) fn should_use_new_llvm_pass_manager( - cgcx: &CodegenContext, + _cgcx: &CodegenContext, config: &ModuleConfig, ) -> bool { - // The new pass manager is enabled by default for LLVM >= 13. - // This matches Clang, which also enables it since Clang 13. - - // FIXME: There are some perf issues with the new pass manager - // when targeting s390x, so it is temporarily disabled for that - // arch, see https://github.com/rust-lang/rust/issues/89609 + // The new pass manager is causing significant performance issues such as #91128, and is + // therefore disabled in stable versions of rustc by default. config .new_llvm_pass_manager - .unwrap_or_else(|| cgcx.target_arch != "s390x" && llvm_util::get_version() >= (13, 0, 0)) + .unwrap_or(false) } pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(