Skip to content

Commit

Permalink
Disable LLVM newPM by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa authored and Mark-Simulacrum committed Jan 5, 2022
1 parent fb57c72 commit ce3d508
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,14 @@ fn get_pgo_sample_use_path(config: &ModuleConfig) -> Option<CString> {
}

pub(crate) fn should_use_new_llvm_pass_manager(
cgcx: &CodegenContext<LlvmCodegenBackend>,
_cgcx: &CodegenContext<LlvmCodegenBackend>,
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(
Expand Down

0 comments on commit ce3d508

Please sign in to comment.