diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-04-25 00:11:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-25 00:11:02 +0200 |
| commit | 433f1f425ee100adf2b8c454170bdee31df56670 (patch) | |
| tree | 59966c93769486757fb4cccfbfc9167cacd894bd /compiler/rustc_codegen_llvm/src/llvm_util.rs | |
| parent | 50294f69cd48e4c9b3ba080632263e2cbb7eb5af (diff) | |
| parent | 6dc0bcc5db00524af73eb7dd2f6e24f38736f1aa (diff) | |
| download | rust-433f1f425ee100adf2b8c454170bdee31df56670.tar.gz rust-433f1f425ee100adf2b8c454170bdee31df56670.zip | |
Rollup merge of #96215 - nikic:legacy-pm-removal, r=nagisa
Drop support for legacy PM with LLVM 15 LLVM 15 already removes some of the legacy PM APIs we're using. This patch forces use of NewPM with LLVM 15 (with `-Z new-llvm-pass-manager=no` throwing a warning) and stubs out various FFI methods with a report_fatal_error on LLVM 15. For LLVMPassManagerBuilderPopulateLTOPassManager() I went with adding our own wrapper, as the alternative would be to muck about with weak symbols, which seems to be non-trivial as far as cross-platform support is concerned (std has `weak!` for this purpose, but only as an internal utility.) Fixes #96072. Fixes #96362.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index c24e369ae72..7b407c94e7b 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -542,6 +542,11 @@ pub(crate) fn should_use_new_llvm_pass_manager(user_opt: &Option<bool>, target_a // The new pass manager is enabled by default for LLVM >= 13. // This matches Clang, which also enables it since Clang 13. + // Since LLVM 15, the legacy pass manager is no longer supported. + if llvm_util::get_version() >= (15, 0, 0) { + return true; + } + // There are some perf issues with the new pass manager when targeting // s390x with LLVM 13, so enable the new pass manager only with LLVM 14. // See https://github.com/rust-lang/rust/issues/89609. |
