From c76b52386058c6d907585e80bf8f817c3e0a6b94 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 30 Sep 2026 14:31:54 -0700 Subject: [PATCH] Update the minimum external LLVM to 22 Co-authored-by: Augie Fackler --- .../src/back/llvm_backend.rs | 7 +- compiler/rustc_codegen_llvm/src/builder.rs | 16 +- compiler/rustc_codegen_llvm/src/context.rs | 27 ---- compiler/rustc_codegen_llvm/src/intrinsic.rs | 147 ++++++------------ compiler/rustc_codegen_llvm/src/llvm_util.rs | 72 +++------ .../rustc_llvm/llvm-wrapper/PassWrapper.cpp | 49 +----- .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 34 ---- library/coretests/tests/num/floats.rs | 26 +--- src/bootstrap/src/core/build_steps/llvm.rs | 4 +- src/ci/docker/README.md | 8 +- .../Dockerfile | 14 +- .../test-x86_64-gnu-llvm-21/Dockerfile | 65 -------- .../test-x86_64-gnu-llvm-22/Dockerfile | 11 +- src/ci/docker/scripts/stage_2_test_set1.sh | 7 - src/ci/docker/scripts/stage_2_test_set2.sh | 17 -- src/ci/github-actions/jobs.yml | 45 ++---- tests/assembly-llvm/asm/loongarch-type.rs | 1 - tests/assembly-llvm/asm/powerpc-types.rs | 2 - tests/assembly-llvm/asm/sparc-types.rs | 1 - tests/assembly-llvm/asm/xtensa-types.rs | 1 - tests/assembly-llvm/bpf_unaligned.rs | 1 - tests/assembly-llvm/c-variadic/xtensa.rs | 1 - tests/assembly-llvm/cmse-clear-padding.rs | 1 - tests/assembly-llvm/tail-call-indirect.rs | 1 - tests/assembly-llvm/targets/targets-elf.rs | 3 - tests/codegen-llvm/amdgpu-addrspacecast.rs | 9 +- tests/codegen-llvm/const-vector.rs | 1 - .../issue-122600-ptr-discriminant-update.rs | 6 - .../pauth-extern-c-direct-indirect-call.rs | 3 - .../scalable-vectors/debuginfo.rs | 11 +- .../simd-intrinsic-generic-gather.rs | 14 +- .../simd-intrinsic-generic-masked-load.rs | 24 +-- .../simd-intrinsic-generic-masked-store.rs | 24 +-- .../simd-intrinsic-generic-scatter.rs | 14 +- tests/codegen-llvm/slp-vectorization-mul3.rs | 1 - tests/codegen-llvm/store-captures.rs | 1 - tests/codegen-llvm/tail-call-u128.rs | 1 - tests/codegen-llvm/vec_pop_push_noop.rs | 4 - tests/codegen-llvm/vecdeque_pop_push.rs | 4 - tests/ui/codegen/huge-stacks.rs | 1 - .../no-unsized-arguments.aarch64.stderr | 6 +- .../no-unsized-arguments.rs | 1 - .../no-unsized-arguments.x86.stderr | 6 +- .../no-unsized-arguments.x86_64.stderr | 6 +- tests/ui/explicit-tail-calls/support/basic.rs | 1 - .../ui/explicit-tail-calls/support/bystack.rs | 14 +- tests/ui/explicit-tail-calls/support/byval.rs | 14 +- .../feature-gate-xtensa-target-feature.rs | 1 - .../feature-gate-xtensa-target-feature.stderr | 2 +- tests/ui/float/minmax.rs | 22 --- 50 files changed, 171 insertions(+), 581 deletions(-) rename src/ci/docker/host-aarch64/{test-aarch64-gnu-llvm-21 => test-aarch64-gnu-llvm-22}/Dockerfile (89%) delete mode 100644 src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-21/Dockerfile delete mode 100644 tests/ui/float/minmax.rs diff --git a/compiler/rustc_codegen_llvm/src/back/llvm_backend.rs b/compiler/rustc_codegen_llvm/src/back/llvm_backend.rs index 3f89777bb28db..8780af2f6d595 100644 --- a/compiler/rustc_codegen_llvm/src/back/llvm_backend.rs +++ b/compiler/rustc_codegen_llvm/src/back/llvm_backend.rs @@ -208,11 +208,12 @@ impl CodegenBackend for LlvmCodegenBackend { // Intrinsics whose fallback body will not be used by the LLVM backend. let replaced_intrinsics = { #[rustfmt::skip] - let mut will_not_use_fallback = vec![ + let will_not_use_fallback = vec![ // These are mapped to LLVM intrinsics instead. sym::unchecked_funnel_shl, sym::unchecked_funnel_shr, sym::carrying_mul_add, + sym::carryless_mul, sym::integer_max, sym::integer_min, @@ -235,10 +236,6 @@ impl CodegenBackend for LlvmCodegenBackend { sym::copysignf16, sym::copysignf32, sym::copysignf64, sym::copysignf128, ]; - if llvm_util::get_version() >= (22, 0, 0) { - will_not_use_fallback.push(sym::carryless_mul); - } - will_not_use_fallback }; diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index dc89414940620..2823b26233557 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -919,9 +919,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { self.set_metadata_node(store, llvm::MD_nontemporal, &[one]); } } - if flags.contains(MemFlags::CAPTURES_READ_ONLY) - && crate::llvm_util::get_version() >= (22, 0, 0) - { + if flags.contains(MemFlags::CAPTURES_READ_ONLY) { assert!( self.type_kind(self.val_ty(val)) == TypeKind::Pointer, "CAPTURED_READ_ONLY is only supported on pointer stores" @@ -1903,14 +1901,10 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> { return; } - if crate::llvm_util::get_version() >= (22, 0, 0) { - // LLVM 22 requires the lifetime intrinsic to act directly on the alloca, - // there can't be an addrspacecast in between. - let ptr = unsafe { llvm::LLVMRustStripPointerCasts(ptr) }; - self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]); - } else { - self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]); - } + // LLVM 22 requires the lifetime intrinsic to act directly on the alloca, + // there can't be an addrspacecast in between. + let ptr = unsafe { llvm::LLVMRustStripPointerCasts(ptr) }; + self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]); } } impl<'a, 'll, CX: Borrow>> GenericBuilder<'a, 'll, CX> { diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 0ce3bfe07c413..d64c8de6ed7aa 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -195,33 +195,6 @@ pub(crate) unsafe fn create_module<'ll>( let mut target_data_layout = sess.target.data_layout.to_string(); let llvm_version = llvm_util::get_version(); - if llvm_version < (22, 0, 0) { - if sess.target.arch == Arch::Avr { - // LLVM 22.0 updated the default layout on avr: https://github.com/llvm/llvm-project/pull/153010 - target_data_layout = target_data_layout.replace("n8:16", "n8") - } - if sess.target.arch == Arch::Nvptx64 { - // LLVM 22 updated the NVPTX layout to indicate 256-bit vector load/store: https://github.com/llvm/llvm-project/pull/155198 - target_data_layout = target_data_layout.replace("-i256:256", ""); - } - if sess.target.arch == Arch::PowerPC64 { - // LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673 - target_data_layout = target_data_layout.replace("-f64:32:64", ""); - - // LLVM 22 fixed the data layout calculation for targets that default to ELFv1 - // when the ABI is set to ELFv2. With LLVM 21, the ELFv1 datalayout must be used, - // which will overalign function entries. - // https://github.com/llvm/llvm-project/pull/149725 - if sess.target.llvm_target == "powerpc64-unknown-linux-gnu" { - target_data_layout = target_data_layout.replace("-Fn32", "-Fi64"); - } - } - if sess.target.arch == Arch::AmdGpu { - // LLVM 22 specified ELF mangling in the amdgpu data layout: - // https://github.com/llvm/llvm-project/pull/163011 - target_data_layout = target_data_layout.replace("-m:e", ""); - } - } if llvm_version < (23, 0, 0) { if sess.target.arch == Arch::S390x { // LLVM 23 updated the s390x layout to specify the stack alignment: https://github.com/llvm/llvm-project/pull/176041 diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index 3163139ba1f04..43608f7dc0771 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -192,7 +192,6 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { let simple = call_simple_intrinsic(self, name, args); let llval = match name { _ if simple.is_some() => simple.unwrap(), - // Need at least LLVM 22 for `min/maximumnum` to not crash LLVM. sym::minimum_number_nsz_f16 | sym::minimum_number_nsz_f32 | sym::minimum_number_nsz_f64 @@ -200,9 +199,7 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { | sym::maximum_number_nsz_f16 | sym::maximum_number_nsz_f32 | sym::maximum_number_nsz_f64 - | sym::maximum_number_nsz_f128 - if llvm_version >= (22, 0, 0) => - { + | sym::maximum_number_nsz_f128 => { let intrinsic_name = if name.as_str().starts_with("min") { "llvm.minimumnum" } else { @@ -457,26 +454,6 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { pair } - // FIXME move into the branch below when LLVM 22 is the lowest version we support. - sym::carryless_mul if llvm_version >= (22, 0, 0) => { - let ty = args[0].layout.ty; - if !ty.is_integral() { - let err = tcx.dcx().emit_err(InvalidMonomorphization::BasicIntegerType { - span, - name, - ty, - }); - return IntrinsicResult::Err(err); - } - let (size, _) = ty.int_size_and_signed(self.tcx); - let width = size.bits(); - let llty = self.type_ix(width); - - let lhs = args[0].immediate(); - let rhs = args[1].immediate(); - self.call_intrinsic("llvm.clmul", &[llty], &[lhs, rhs]) - } - sym::ctlz | sym::ctlz_nonzero | sym::cttz @@ -484,6 +461,7 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { | sym::ctpop | sym::bswap | sym::bitreverse + | sym::carryless_mul | sym::integer_max | sym::integer_min | sym::saturating_add @@ -530,6 +508,11 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { sym::bitreverse => { self.call_intrinsic("llvm.bitreverse", &[llty], &[args[0].immediate()]) } + sym::carryless_mul => { + let lhs = args[0].immediate(); + let rhs = args[1].immediate(); + self.call_intrinsic("llvm.clmul", &[llty], &[lhs, rhs]) + } sym::integer_min | sym::integer_max => { let lhs = args[0].immediate(); let rhs = args[1].immediate(); @@ -2118,8 +2101,6 @@ fn generic_simd_intrinsic<'ll, 'tcx>( }; } - let llvm_version = crate::llvm_util::get_version(); - /// Converts a vector mask, where each element has a bit width equal to the data elements it is used with, /// down to an i1 based mask that can be used by llvm intrinsics. /// @@ -2666,22 +2647,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>( // Type of the vector of elements: let llvm_elem_vec_ty = llvm_vector_ty(bx, element_ty0, in_len); - let args: &[&'ll Value] = if llvm_version < (22, 0, 0) { - let alignment = bx.const_i32(alignment as i32); - &[args[1].immediate(), alignment, mask, args[0].immediate()] - } else { - &[args[1].immediate(), mask, args[0].immediate()] - }; - - let call = - bx.call_intrinsic("llvm.masked.gather", &[llvm_elem_vec_ty, llvm_pointer_vec_ty], args); - if llvm_version >= (22, 0, 0) { - crate::attributes::apply_to_callsite( - call, - crate::llvm::AttributePlace::Argument(0), - &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], - ) - } + let call = bx.call_intrinsic( + "llvm.masked.gather", + &[llvm_elem_vec_ty, llvm_pointer_vec_ty], + &[args[1].immediate(), mask, args[0].immediate()], + ); + crate::attributes::apply_to_callsite( + call, + crate::llvm::AttributePlace::Argument(0), + &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], + ); return Ok(call); } @@ -2772,22 +2747,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>( // Type of the vector of elements: let llvm_elem_vec_ty = llvm_vector_ty(bx, values_elem, values_len); - let args: &[&'ll Value] = if llvm_version < (22, 0, 0) { - let alignment = bx.const_i32(alignment as i32); - - &[args[1].immediate(), alignment, mask, args[2].immediate()] - } else { - &[args[1].immediate(), mask, args[2].immediate()] - }; - - let call = bx.call_intrinsic("llvm.masked.load", &[llvm_elem_vec_ty, llvm_pointer], args); - if llvm_version >= (22, 0, 0) { - crate::attributes::apply_to_callsite( - call, - crate::llvm::AttributePlace::Argument(0), - &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], - ) - } + let call = bx.call_intrinsic( + "llvm.masked.load", + &[llvm_elem_vec_ty, llvm_pointer], + &[args[1].immediate(), mask, args[2].immediate()], + ); + crate::attributes::apply_to_callsite( + call, + crate::llvm::AttributePlace::Argument(0), + &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], + ); return Ok(call); } @@ -2859,21 +2828,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>( // Type of the vector of elements: let llvm_elem_vec_ty = llvm_vector_ty(bx, values_elem, values_len); - let args: &[&'ll Value] = if llvm_version < (22, 0, 0) { - let alignment = bx.const_i32(alignment as i32); - &[args[2].immediate(), args[1].immediate(), alignment, mask] - } else { - &[args[2].immediate(), args[1].immediate(), mask] - }; - - let call = bx.call_intrinsic("llvm.masked.store", &[llvm_elem_vec_ty, llvm_pointer], args); - if llvm_version >= (22, 0, 0) { - crate::attributes::apply_to_callsite( - call, - crate::llvm::AttributePlace::Argument(1), - &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], - ) - } + let call = bx.call_intrinsic( + "llvm.masked.store", + &[llvm_elem_vec_ty, llvm_pointer], + &[args[2].immediate(), args[1].immediate(), mask], + ); + crate::attributes::apply_to_callsite( + call, + crate::llvm::AttributePlace::Argument(1), + &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], + ); return Ok(call); } @@ -2949,24 +2913,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>( // Type of the vector of elements: let llvm_elem_vec_ty = llvm_vector_ty(bx, element_ty0, in_len); - let args: &[&'ll Value] = if llvm_version < (22, 0, 0) { - let alignment = bx.const_i32(alignment as i32); - &[args[0].immediate(), args[1].immediate(), alignment, mask] - } else { - &[args[0].immediate(), args[1].immediate(), mask] - }; + let call = bx.call_intrinsic( "llvm.masked.scatter", &[llvm_elem_vec_ty, llvm_pointer_vec_ty], - args, + &[args[0].immediate(), args[1].immediate(), mask], + ); + crate::attributes::apply_to_callsite( + call, + crate::llvm::AttributePlace::Argument(1), + &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], ); - if llvm_version >= (22, 0, 0) { - crate::attributes::apply_to_callsite( - call, - crate::llvm::AttributePlace::Argument(1), - &[crate::llvm::CreateAlignmentAttr(bx.llcx, alignment)], - ) - } return Ok(call); } @@ -3448,17 +3405,11 @@ fn generic_simd_intrinsic<'ll, 'tcx>( &[vec_ty], &[args[0].immediate(), args[1].immediate(), args[2].immediate()], )), - sym::simd_carryless_mul => { - if crate::llvm_util::get_version() >= (22, 0, 0) { - Ok(bx.call_intrinsic( - llvm_intrinsic, - &[vec_ty], - &[args[0].immediate(), args[1].immediate()], - )) - } else { - span_bug!(span, "`simd_carryless_mul` needs LLVM 22 or higher"); - } - } + sym::simd_carryless_mul => Ok(bx.call_intrinsic( + llvm_intrinsic, + &[vec_ty], + &[args[0].immediate(), args[1].immediate()], + )), _ => unreachable!(), }; } diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index 4db534b978330..a582e897eef9c 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -262,7 +262,7 @@ pub(crate) fn to_llvm_features<'a>(target: &Target, s: &'a str) -> Option None, // only existed in 18 // Withdrawn by ARM; removed from LLVM in 22 - "tme" if major >= 22 => None, + "tme" => None, s => Some(LLVMFeature::new(s)), } } @@ -270,10 +270,6 @@ pub(crate) fn to_llvm_features<'a>(target: &Target, s: &'a str) -> Option Some(LLVMFeature::new("fullfp16")), s => Some(LLVMFeature::new(s)), }, - Arch::Bpf => match s { - "allows-misaligned-mem-access" if major < 22 => None, - s => Some(LLVMFeature::new(s)), - }, Arch::Nvptx64 => match s { "sm_101" if major >= 24 => Some(LLVMFeature::new("sm_110")), "sm_101a" if major >= 24 => Some(LLVMFeature::new("sm_110a")), @@ -294,43 +290,30 @@ pub(crate) fn to_llvm_features<'a>(target: &Target, s: &'a str) -> Option Some(LLVMFeature::new("hasleoncasa")), s => Some(LLVMFeature::new(s)), }, - Arch::Wasm32 | Arch::Wasm64 => match s { - "gc" if major < 22 => None, + Arch::X86 | Arch::X86_64 => match s { + "sse4.2" => Some(LLVMFeature::with_dependencies( + "sse4.2", + smallvec![TargetFeatureFoldStrength::EnableOnly("crc32")], + )), + "pclmulqdq" => Some(LLVMFeature::new("pclmul")), + "rdrand" => Some(LLVMFeature::new("rdrnd")), + "bmi1" => Some(LLVMFeature::new("bmi")), + "cmpxchg16b" => Some(LLVMFeature::new("cx16")), + "lahfsahf" => Some(LLVMFeature::new("sahf")), + "apxf" => Some(LLVMFeature::with_dependencies( + "egpr", + smallvec![ + TargetFeatureFoldStrength::Both("push2pop2"), + TargetFeatureFoldStrength::Both("ppx"), + TargetFeatureFoldStrength::Both("ndd"), + TargetFeatureFoldStrength::Both("ccmp"), + TargetFeatureFoldStrength::Both("cf"), + TargetFeatureFoldStrength::Both("nf"), + TargetFeatureFoldStrength::Both("zu"), + ], + )), s => Some(LLVMFeature::new(s)), }, - Arch::X86 | Arch::X86_64 => { - match s { - "sse4.2" => Some(LLVMFeature::with_dependencies( - "sse4.2", - smallvec![TargetFeatureFoldStrength::EnableOnly("crc32")], - )), - "pclmulqdq" => Some(LLVMFeature::new("pclmul")), - "rdrand" => Some(LLVMFeature::new("rdrnd")), - "bmi1" => Some(LLVMFeature::new("bmi")), - "cmpxchg16b" => Some(LLVMFeature::new("cx16")), - "lahfsahf" => Some(LLVMFeature::new("sahf")), - // Enable the evex512 target feature if an avx512 target feature is enabled. - s if s.starts_with("avx512") && major < 22 => Some(LLVMFeature::with_dependencies( - s, - smallvec![TargetFeatureFoldStrength::EnableOnly("evex512")], - )), - "avx10.1" if major < 22 => Some(LLVMFeature::new("avx10.1-512")), - "avx10.2" if major < 22 => Some(LLVMFeature::new("avx10.2-512")), - "apxf" => Some(LLVMFeature::with_dependencies( - "egpr", - smallvec![ - TargetFeatureFoldStrength::Both("push2pop2"), - TargetFeatureFoldStrength::Both("ppx"), - TargetFeatureFoldStrength::Both("ndd"), - TargetFeatureFoldStrength::Both("ccmp"), - TargetFeatureFoldStrength::Both("cf"), - TargetFeatureFoldStrength::Both("nf"), - TargetFeatureFoldStrength::Both("zu"), - ], - )), - s => Some(LLVMFeature::new(s)), - } - } _ => Some(LLVMFeature::new(s)), } } @@ -396,18 +379,11 @@ fn update_target_reliable_float_cfg(target: &Target, cfg: &mut TargetConfig) { let (major, _, _) = version; cfg.has_reliable_f16 = match (target_arch, target_os) { - // Unsupported (fixed in llvm22) - (Arch::Arm64EC, _) if major < 22 => false, // MinGW ABI bugs resolved in GCC 16 // but our toolchain hasn't been updated. (Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm => { false } - // Infinite recursion - (Arch::CSky, _) if major < 22 => false, // (fixed in llvm22) - (Arch::PowerPC | Arch::PowerPC64, _) if major < 22 => false, // (fixed in llvm22) - (Arch::Sparc | Arch::Sparc64, _) if major < 22 => false, // (fixed in llvm22) - (Arch::Wasm32 | Arch::Wasm64, _) if major < 22 => false, // (fixed in llvm22) // `f16` support only requires that symbols converting to and from `f32` are available. We // provide these in `compiler-builtins`, so `f16` should be available on all platforms that // do not have other ABI issues or LLVM crashes. @@ -447,8 +423,6 @@ fn update_target_reliable_float_cfg(target: &Target, cfg: &mut TargetConfig) { (Arch::PowerPC64, Os::Aix) => false, // ABI bugs on BE without +vsx . (Arch::PowerPC64, _) => cfg.internal_target_features.contains(&sym::vsx), - // ABI unsupported (fixed in llvm22) - (Arch::Sparc, _) if major < 22 => false, // MinGW ABI bugs (fixed in llvm23) (Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm && major < 23 => diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index d16d9db799be1..3873701ae09ac 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -5,10 +5,8 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/Lint.h" -#include "llvm/Analysis/TargetLibraryInfo.h" -#if LLVM_VERSION_GE(22, 0) #include "llvm/Analysis/RuntimeLibcallInfo.h" -#endif +#include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/Bitcode/BitcodeWriterPass.h" #include "llvm/CodeGen/CommandFlags.h" @@ -24,12 +22,8 @@ #include "llvm/MC/TargetRegistry.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Passes/PassBuilder.h" -#if LLVM_VERSION_GE(22, 0) -#include "llvm/Plugins/PassPlugin.h" -#else -#include "llvm/Passes/PassPlugin.h" -#endif #include "llvm/Passes/StandardInstrumentations.h" +#include "llvm/Plugins/PassPlugin.h" #include "llvm/Support/CBindingWrapping.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Program.h" @@ -100,11 +94,7 @@ LLVMRustCreateMCSubtargetInfo(const char *TripleStr, const char *CPU, return nullptr; } -#if LLVM_VERSION_GE(22, 0) return TheTarget->createMCSubtargetInfo(Trip, CPU, Features); -#else - return TheTarget->createMCSubtargetInfo(Trip.str(), CPU, Features); -#endif } extern "C" bool LLVMRustMCSubtargetInfoCheckFeatures(MCSubtargetInfo *MCInfo, @@ -498,7 +488,7 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMModuleRef M, // module flags respectively instead. PM->add(new RuntimeLibraryInfoWrapper(Options->MCOptions.ABIName, Options->VecLib)); -#elif LLVM_VERSION_GE(22, 0) +#else PM->add(new RuntimeLibraryInfoWrapper( TargetTriple, Options->ExceptionModel, Options->FloatABIType, Options->EABIVersion, Options->MCOptions.ABIName, Options->VecLib)); @@ -721,44 +711,25 @@ extern "C" LLVMRustResult LLVMRustOptimize( } std::optional PGOOpt; -#if LLVM_VERSION_LT(22, 0) - auto FS = vfs::getRealFileSystem(); -#endif if (PGOGenPath) { assert(!PGOUsePath && !PGOSampleUsePath); PGOOpt = PGOOptions( -#if LLVM_VERSION_GE(22, 0) PGOGenPath, "", "", "", PGOOptions::IRInstr, PGOOptions::NoCSAction, -#else - PGOGenPath, "", "", "", FS, PGOOptions::IRInstr, PGOOptions::NoCSAction, -#endif PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling); } else if (PGOUsePath) { assert(!PGOSampleUsePath); PGOOpt = PGOOptions( -#if LLVM_VERSION_GE(22, 0) PGOUsePath, "", "", "", PGOOptions::IRUse, PGOOptions::NoCSAction, -#else - PGOUsePath, "", "", "", FS, PGOOptions::IRUse, PGOOptions::NoCSAction, -#endif PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling); } else if (PGOSampleUsePath) { PGOOpt = -#if LLVM_VERSION_GE(22, 0) PGOOptions(PGOSampleUsePath, "", "", "", PGOOptions::SampleUse, -#else - PGOOptions(PGOSampleUsePath, "", "", "", FS, PGOOptions::SampleUse, -#endif PGOOptions::NoCSAction, PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling); } else if (DebugInfoForProfiling) { - PGOOpt = PGOOptions( -#if LLVM_VERSION_GE(22, 0) - "", "", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction, -#else - "", "", "", "", FS, PGOOptions::NoAction, PGOOptions::NoCSAction, -#endif - PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling); + PGOOpt = + PGOOptions("", "", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction, + PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling); } auto PB = PassBuilder(TM, PTO, PGOOpt, &PIC); @@ -1389,11 +1360,7 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, size_t num_modules, // being lifted from `lib/LTO/LTO.cpp` as well DenseMap PrevailingCopy; for (auto &I : Ret->Index) { -#if LLVM_VERSION_GE(22, 0) const auto &SummaryList = I.second.getSummaryList(); -#else - const auto &SummaryList = I.second.SummaryList; -#endif if (SummaryList.size() > 1) PrevailingCopy[I.first] = getFirstDefinitionForLinker(SummaryList); } @@ -1426,11 +1393,7 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, size_t num_modules, // linkage will stay as external, and internal will stay as internal. std::set ExportedGUIDs; for (auto &List : Ret->Index) { -#if LLVM_VERSION_GE(22, 0) const auto &SummaryList = List.second.getSummaryList(); -#else - const auto &SummaryList = List.second.SummaryList; -#endif for (auto &GVS : SummaryList) { if (GlobalValue::isLocalLinkage(GVS->linkage())) continue; diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index bc8fa60b66a52..16c7daf66f095 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1164,16 +1164,10 @@ LLVMRustDICreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Type, LLVMMetadataRef Subscripts, LLVMMetadataRef BitStride) { -#if LLVM_VERSION_GE(22, 0) return wrap(unwrap(Builder)->createVectorType( Size, AlignInBits, unwrapDI(Type), DINodeArray(unwrapDI(Subscripts)), unwrapDI(BitStride))); -#else - return wrap(unwrap(Builder)->createVectorType( - Size, AlignInBits, unwrapDI(Type), - DINodeArray(unwrapDI(Subscripts)))); -#endif } extern "C" LLVMMetadataRef @@ -1562,13 +1556,11 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler( RemarkStreamer(std::move(RemarkStreamer)), LlvmRemarkStreamer(std::move(LlvmRemarkStreamer)) {} -#if LLVM_VERSION_GE(22, 0) ~RustDiagnosticHandler() { if (RemarkStreamer) { RemarkStreamer->releaseSerializer(); } } -#endif virtual bool handleDiagnostics(const DiagnosticInfo &DI) override { // If this diagnostic is one of the optimization remark kinds, we can @@ -1664,14 +1656,8 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler( // Do not delete the file after we gather remarks RemarkFile->keep(); -#if LLVM_VERSION_GE(22, 0) auto RemarkSerializer = remarks::createRemarkSerializer( llvm::remarks::Format::YAML, RemarkFile->os()); -#else - auto RemarkSerializer = remarks::createRemarkSerializer( - llvm::remarks::Format::YAML, remarks::SerializerMode::Separate, - RemarkFile->os()); -#endif if (Error E = RemarkSerializer.takeError()) { std::string Error = std::string("Cannot create remark serializer: ") + toString(std::move(E)); @@ -1777,16 +1763,12 @@ extern "C" LLVMValueRef LLVMRustConstPtrAuth(LLVMValueRef Ptr, uint32_t Key, AddrDiversity ? dyn_cast(unwrap(AddrDiversity)) : ConstantPointerNull::get(cast(C->getType())); assert(AddrDiv && "Failed to get Address Diversity"); -#if LLVM_VERSION_GE(22, 0) Constant *DeactivationSym = DeactivationSymbol ? dyn_cast(unwrap(DeactivationSymbol)) : ConstantPointerNull::get(PTy); assert(DeactivationSym && "Failed to get Deactivation Symbol"); return wrap(ConstantPtrAuth::get(C, KeyC, DiscC, AddrDiv, DeactivationSym)); -#else - return wrap(ConstantPtrAuth::get(C, KeyC, DiscC, AddrDiv)); -#endif } // Statically assert that the fixed metadata kind IDs declared in @@ -1885,7 +1867,6 @@ class RustSanitizerSpecialCaseList : public llvm::SpecialCaseList { std::vector SanitizerSections; -#if LLVM_VERSION_GE(22, 0) static bool matchSection(const Section &S, llvm::StringRef Name) { return S.matchName(Name); } @@ -1894,24 +1875,9 @@ class RustSanitizerSpecialCaseList : public llvm::SpecialCaseList { return S.getLastMatch(Prefix, Query, Category); } static unsigned getFileIndex(const Section &S) { return S.fileIndex(); } -#else - static bool matchSection(const Section &S, llvm::StringRef Name) { - return S.SectionMatcher && S.SectionMatcher->match(Name) != 0; - } - unsigned getLastMatch(const Section &S, llvm::StringRef Prefix, - llvm::StringRef Query, llvm::StringRef Category) const { - return llvm::SpecialCaseList::inSectionBlame(S.Entries, Prefix, Query, - Category); - } - static unsigned getFileIndex(const Section &S) { return S.FileIdx; } -#endif void createSanitizerSections() { -#if LLVM_VERSION_GE(22, 0) const auto &SecList = sections(); -#else - const auto &SecList = Sections; -#endif for (const auto &S : SecList) { uint32_t Mask = 0; diff --git a/library/coretests/tests/num/floats.rs b/library/coretests/tests/num/floats.rs index 7093687f04b15..84d645ce31f3c 100644 --- a/library/coretests/tests/num/floats.rs +++ b/library/coretests/tests/num/floats.rs @@ -727,15 +727,10 @@ float_test! { assert_biteq!(flt(9.0).min(black_box(Float::NAN)), 9.0); assert_biteq!(black_box(flt(-9.0)).min(Float::NAN), -9.0); assert!(Float::NAN.min(Float::NAN).is_nan()); - // FIXME(llvm21): LLVM miscompiles the fallback impl on aarch64 and likely other targets - // (https://github.com/llvm/llvm-project/issues/176624). When we require LLVM 22, - // remove the ui test `tests/ui/float/minmax.rs` and unconditionally enable the test here. - if cfg!(miri) { - assert_biteq!(Float::SNAN.min(black_box(9.0)), 9.0); - assert_biteq!(black_box(Float::SNAN).min(-9.0), -9.0); - assert_biteq!(flt(9.0).min(black_box(Float::SNAN)), 9.0); - assert_biteq!(black_box(flt(-9.0)).min(Float::SNAN), -9.0); - } + assert_biteq!(Float::SNAN.min(black_box(9.0)), 9.0); + assert_biteq!(black_box(Float::SNAN).min(-9.0), -9.0); + assert_biteq!(flt(9.0).min(black_box(Float::SNAN)), 9.0); + assert_biteq!(black_box(flt(-9.0)).min(Float::SNAN), -9.0); assert!(Float::SNAN.min(Float::SNAN).is_nan()); } } @@ -770,15 +765,10 @@ float_test! { assert_biteq!(flt(9.0).max(black_box(Float::NAN)), 9.0); assert_biteq!(black_box(flt(-9.0)).max(Float::NAN), -9.0); assert!(Float::NAN.max(Float::NAN).is_nan()); - // FIXME(llvm21): LLVM miscompiles the fallback impl on aarch64 and likely other targets - // (https://github.com/llvm/llvm-project/issues/176624). When we require LLVM 22, - // remove the ui test `tests/ui/float/minmax.rs` and unconditionally enable the test here. - if cfg!(miri) { - assert_biteq!(Float::SNAN.max(black_box(9.0)), 9.0); - assert_biteq!(black_box(Float::SNAN).max(-9.0), -9.0); - assert_biteq!(flt(9.0).max(black_box(Float::SNAN)), 9.0); - assert_biteq!(black_box(flt(-9.0)).max(Float::SNAN), -9.0); - } + assert_biteq!(Float::SNAN.max(black_box(9.0)), 9.0); + assert_biteq!(black_box(Float::SNAN).max(-9.0), -9.0); + assert_biteq!(flt(9.0).max(black_box(Float::SNAN)), 9.0); + assert_biteq!(black_box(flt(-9.0)).max(Float::SNAN), -9.0); assert!(Float::SNAN.max(Float::SNAN).is_nan()); } } diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 625b3959d3326..5dae391cc4bee 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -804,11 +804,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) { let version = get_llvm_version(builder, llvm_config); let mut parts = version.split('.').take(2).filter_map(|s| s.parse::().ok()); if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) - && major >= 21 + && major >= 22 { return; } - panic!("\n\nbad LLVM version: {version}, need >=21\n\n") + panic!("\n\nbad LLVM version: {version}, need >=22\n\n") } /// C/C++ debug info remap flags for LLVM build. diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md index 8360c8e9d8b48..167121a5a000c 100644 --- a/src/ci/docker/README.md +++ b/src/ci/docker/README.md @@ -14,9 +14,9 @@ To run a specific CI job locally, you can use the `citool` Rust crate: cargo run --manifest-path src/ci/citool/Cargo.toml run-local ``` -For example, to run the `x86_64-gnu-llvm-21-1` job: +For example, to run the `x86_64-gnu-llvm-22-1` job: ``` -cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-llvm-21-1 +cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-llvm-22-1 ``` The job will output artifacts in an `obj/` dir at the root of a repository. Note @@ -27,10 +27,10 @@ Docker image executed in the given CI job. while locally, to the `obj/` directory. This is primarily to prevent strange linker errors when using multiple Docker images. -For some Linux workflows (for example `x86_64-gnu-llvm-21-N`), the process is more involved. You will need to see which script is executed for the given workflow inside the [`jobs.yml`](../github-actions/jobs.yml) file and pass it through the `DOCKER_SCRIPT` environment variable. For example, to reproduce the `x86_64-gnu-llvm-21-3` workflow, you can run the following script: +For some Linux workflows (for example `x86_64-gnu-llvm-22-N`), the process is more involved. You will need to see which script is executed for the given workflow inside the [`jobs.yml`](../github-actions/jobs.yml) file and pass it through the `DOCKER_SCRIPT` environment variable. For example, to reproduce the `x86_64-gnu-llvm-22-3` workflow, you can run the following script: ``` -DOCKER_SCRIPT=x86_64-gnu-llvm3.sh ./src/ci/docker/run.sh x86_64-gnu-llvm-21 +DOCKER_SCRIPT=x86_64-gnu-llvm3.sh ./src/ci/docker/run.sh x86_64-gnu-llvm-22 ``` ## Local Development diff --git a/src/ci/docker/host-aarch64/test-aarch64-gnu-llvm-21/Dockerfile b/src/ci/docker/host-aarch64/test-aarch64-gnu-llvm-22/Dockerfile similarity index 89% rename from src/ci/docker/host-aarch64/test-aarch64-gnu-llvm-21/Dockerfile rename to src/ci/docker/host-aarch64/test-aarch64-gnu-llvm-22/Dockerfile index fe6c2d40f5f5c..53030a098841d 100644 --- a/src/ci/docker/host-aarch64/test-aarch64-gnu-llvm-21/Dockerfile +++ b/src/ci/docker/host-aarch64/test-aarch64-gnu-llvm-22/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:25.10 +FROM ubuntu:26.04 ARG DEBIAN_FRONTEND=noninteractive @@ -15,10 +15,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ cmake \ sudo \ gdb \ - llvm-21-tools \ - llvm-21-dev \ - lldb-21 \ - python3-lldb-21 \ + llvm-22-tools \ + llvm-22-dev \ + lldb-22 \ + python3-lldb-22 \ libedit-dev \ libssl-dev \ pkg-config \ @@ -43,11 +43,11 @@ ENV NO_DOWNLOAD_CI_LLVM="1" ENV EXTERNAL_LLVM="1" # Override the default debugger `discover` behavior -ENV LLDB_PATH="lldb-21" +ENV LLDB_PATH="lldb-22" # Using llvm-link-shared due to libffi issues -- see #34486 ENV RUST_CONFIGURE_ARGS="--build=aarch64-unknown-linux-gnu \ - --llvm-root=/usr/lib/llvm-21 \ + --llvm-root=/usr/lib/llvm-22 \ --enable-llvm-link-shared \ --set rust.randomize-layout=true \ --set rust.thin-lto-import-instr-limit=10" diff --git a/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-21/Dockerfile b/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-21/Dockerfile deleted file mode 100644 index fc96735521077..0000000000000 --- a/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-21/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -FROM ubuntu:25.10 - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y --no-install-recommends \ - bzip2 \ - g++ \ - gcc-multilib \ - make \ - ninja-build \ - file \ - curl \ - ca-certificates \ - python3 \ - git \ - cmake \ - sudo \ - gdb \ - llvm-21-tools \ - llvm-21-dev \ - libedit-dev \ - libssl-dev \ - pkg-config \ - zlib1g-dev \ - xz-utils \ - nodejs \ - mingw-w64 \ - # libgccjit dependencies - flex \ - libmpfr-dev \ - libgmp-dev \ - libmpc3 \ - libmpc-dev \ - && rm -rf /var/lib/apt/lists/* - -# Install powershell (universal package) so we can test x.ps1 on Linux -# FIXME: need a "universal" version that supports libicu74, but for now it still works to ignore that dep. -RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \ - dpkg --ignore-depends=libicu72 -i powershell.deb && \ - rm -f powershell.deb - -COPY scripts/sccache.sh /scripts/ -RUN sh /scripts/sccache.sh - -# We are disabling CI LLVM since this builder is intentionally using a host -# LLVM, rather than the typical src/llvm-project LLVM. -ENV NO_DOWNLOAD_CI_LLVM="1" -ENV EXTERNAL_LLVM="1" - -# Using llvm-link-shared due to libffi issues -- see #34486 -ENV RUST_CONFIGURE_ARGS="--build=x86_64-unknown-linux-gnu \ - --llvm-root=/usr/lib/llvm-21 \ - --enable-llvm-link-shared \ - --set rust.randomize-layout=true \ - --set rust.thin-lto-import-instr-limit=10" - -COPY scripts/shared.sh /scripts/ - -COPY scripts/x86_64-gnu-llvm.sh /scripts/ -COPY scripts/x86_64-gnu-llvm2.sh /scripts/ -COPY scripts/x86_64-gnu-llvm3.sh /scripts/ -COPY scripts/stage_2_test_set1.sh /scripts/ -COPY scripts/stage_2_test_set2.sh /scripts/ - -ENV SCRIPT="Must specify DOCKER_SCRIPT for this image" diff --git a/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-22/Dockerfile b/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-22/Dockerfile index a22e8de90804f..e7191aa31c47b 100644 --- a/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-22/Dockerfile +++ b/src/ci/docker/host-x86_64/test-x86_64-gnu-llvm-22/Dockerfile @@ -44,16 +44,15 @@ RUN sh /scripts/sccache.sh # We are disabling CI LLVM since this builder is intentionally using a host # LLVM, rather than the typical src/llvm-project LLVM. -ENV NO_DOWNLOAD_CI_LLVM 1 -ENV EXTERNAL_LLVM 1 +ENV NO_DOWNLOAD_CI_LLVM="1" +ENV EXTERNAL_LLVM="1" # Using llvm-link-shared due to libffi issues -- see #34486 -ENV RUST_CONFIGURE_ARGS \ - --build=x86_64-unknown-linux-gnu \ +ENV RUST_CONFIGURE_ARGS="--build=x86_64-unknown-linux-gnu \ --llvm-root=/usr/lib/llvm-22 \ --enable-llvm-link-shared \ --set rust.randomize-layout=true \ - --set rust.thin-lto-import-instr-limit=10 + --set rust.thin-lto-import-instr-limit=10" COPY scripts/shared.sh /scripts/ @@ -63,4 +62,4 @@ COPY scripts/x86_64-gnu-llvm3.sh /scripts/ COPY scripts/stage_2_test_set1.sh /scripts/ COPY scripts/stage_2_test_set2.sh /scripts/ -ENV SCRIPT "Must specify DOCKER_SCRIPT for this image" +ENV SCRIPT="Must specify DOCKER_SCRIPT for this image" diff --git a/src/ci/docker/scripts/stage_2_test_set1.sh b/src/ci/docker/scripts/stage_2_test_set1.sh index 62b3c2c051a40..15d24533c388d 100755 --- a/src/ci/docker/scripts/stage_2_test_set1.sh +++ b/src/ci/docker/scripts/stage_2_test_set1.sh @@ -14,14 +14,7 @@ if [ "$PR_CI_JOB" == "1" ]; then SKIP_TIDY="--skip tidy" fi -# Skip intrinsic-test on LLVM 21 to avoid CI failures. -if [ "$LLVM_VERSION" = "21" ]; then - echo "LLVM_VERSION is 21; skipping intrinsic-test" - SKIP_INTRINSICS="--skip intrinsic-test" -fi - ../x.py --stage 2 test \ ${SKIP_TIDY:+$SKIP_TIDY} \ - ${SKIP_INTRINSICS:+$SKIP_INTRINSICS} \ --skip compiler \ --skip src diff --git a/src/ci/docker/scripts/stage_2_test_set2.sh b/src/ci/docker/scripts/stage_2_test_set2.sh index c0cdc31011378..5a954f5e9e63f 100755 --- a/src/ci/docker/scripts/stage_2_test_set2.sh +++ b/src/ci/docker/scripts/stage_2_test_set2.sh @@ -14,25 +14,8 @@ if [ "$PR_CI_JOB" == "1" ]; then SKIP_TIDY="--skip tidy" fi -# The combination of rust.randomize-layout and LLVM 21 is causing random -# SIGSEGV in the `hir-def` rust-analyzer tests. Since it seems to be fixed in -# LLVM 22, let's just disable this for now since it has been disruptive for -# CI. See https://github.com/rust-lang/rust/issues/156460. -if [[ "$CI_JOB_NAME" == *"llvm-21"* ]]; then - echo "CI_JOB_NAME contains 'llvm-21'; skipping rust-analyzer" - SKIP_RUST_ANALYZER="--skip src/tools/rust-analyzer" -fi - -# Skip intrinsic-test on LLVM 21 to avoid CI failures. -if [ "$LLVM_VERSION" = "21" ]; then - echo "LLVM_VERSION is 21; skipping intrinsic-test" - SKIP_INTRINSICS="--skip intrinsic-test" -fi - ../x.py --stage 2 test \ ${SKIP_TIDY:+$SKIP_TIDY} \ - ${SKIP_INTRINSICS:+$SKIP_INTRINSICS} \ - ${SKIP_RUST_ANALYZER:+$SKIP_RUST_ANALYZER} \ --skip tests \ --skip library \ --skip tidyselftest diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 0fdf50d20a255..57432451b9798 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -126,21 +126,21 @@ pr: # tidy. This speeds up the PR CI job by ~1 minute. SKIP_SUBMODULES: src/gcc <<: *job-linux-4c - - name: test-x86_64-gnu-llvm-21 + - name: test-x86_64-gnu-llvm-22 env: ENABLE_GCC_CODEGEN: "1" DOCKER_SCRIPT: x86_64-gnu-llvm.sh <<: *job-linux-4c - - name: test-aarch64-gnu-llvm-21-1 + - name: test-aarch64-gnu-llvm-22-1 env: - IMAGE: test-aarch64-gnu-llvm-21 - LLVM_VERSION: "21" + IMAGE: test-aarch64-gnu-llvm-22 + LLVM_VERSION: "22" DOCKER_SCRIPT: stage_2_test_set1.sh <<: *job-aarch64-linux - - name: test-aarch64-gnu-llvm-21-2 + - name: test-aarch64-gnu-llvm-22-2 env: - IMAGE: test-aarch64-gnu-llvm-21 - LLVM_VERSION: "21" + IMAGE: test-aarch64-gnu-llvm-22 + LLVM_VERSION: "22" DOCKER_SCRIPT: stage_2_test_set2.sh <<: *job-aarch64-linux - name: test-x86_64-gnu-tools @@ -428,40 +428,13 @@ auto: - name: test-x86_64-gnu-distcheck <<: *job-linux-4c - # The x86_64-gnu-llvm-21 job is split into multiple jobs to run tests in parallel. - # x86_64-gnu-llvm-21-1 skips tests that run in x86_64-gnu-llvm-21-{2,3}. - - name: test-x86_64-gnu-llvm-21-1 - env: - RUST_BACKTRACE: 1 - IMAGE: test-x86_64-gnu-llvm-21 - LLVM_VERSION: "21" - DOCKER_SCRIPT: stage_2_test_set2.sh - <<: *job-linux-4c - - # Skip tests that run in x86_64-gnu-llvm-21-{1,3} - - name: test-x86_64-gnu-llvm-21-2 - env: - RUST_BACKTRACE: 1 - IMAGE: test-x86_64-gnu-llvm-21 - LLVM_VERSION: "21" - DOCKER_SCRIPT: x86_64-gnu-llvm2.sh - <<: *job-linux-4c - - # Skip tests that run in x86_64-gnu-llvm-21-{1,2} - - name: test-x86_64-gnu-llvm-21-3 - env: - RUST_BACKTRACE: 1 - IMAGE: test-x86_64-gnu-llvm-21 - LLVM_VERSION: "21" - DOCKER_SCRIPT: x86_64-gnu-llvm3.sh - <<: *job-linux-4c - # The x86_64-gnu-llvm-22 job is split into multiple jobs to run tests in parallel. # x86_64-gnu-llvm-22-1 skips tests that run in x86_64-gnu-llvm-22-{2,3}. - name: test-x86_64-gnu-llvm-22-1 env: RUST_BACKTRACE: 1 IMAGE: test-x86_64-gnu-llvm-22 + LLVM_VERSION: "22" DOCKER_SCRIPT: stage_2_test_set2.sh <<: *job-linux-4c @@ -470,6 +443,7 @@ auto: env: RUST_BACKTRACE: 1 IMAGE: test-x86_64-gnu-llvm-22 + LLVM_VERSION: "22" DOCKER_SCRIPT: x86_64-gnu-llvm2.sh <<: *job-linux-4c @@ -478,6 +452,7 @@ auto: env: RUST_BACKTRACE: 1 IMAGE: test-x86_64-gnu-llvm-22 + LLVM_VERSION: "22" DOCKER_SCRIPT: x86_64-gnu-llvm3.sh <<: *job-linux-4c diff --git a/tests/assembly-llvm/asm/loongarch-type.rs b/tests/assembly-llvm/asm/loongarch-type.rs index 5efad583a39df..124d82c5d5d6c 100644 --- a/tests/assembly-llvm/asm/loongarch-type.rs +++ b/tests/assembly-llvm/asm/loongarch-type.rs @@ -8,7 +8,6 @@ //@[loongarch32r] compile-flags: --target loongarch32-unknown-none //@[loongarch32r] needs-llvm-components: loongarch -//@[loongarch32r] min-llvm-version: 22 //@[loongarch64] compile-flags: --target loongarch64-unknown-none //@[loongarch64] needs-llvm-components: loongarch diff --git a/tests/assembly-llvm/asm/powerpc-types.rs b/tests/assembly-llvm/asm/powerpc-types.rs index 1fbf4be0aa3c5..44e14b53b8c52 100644 --- a/tests/assembly-llvm/asm/powerpc-types.rs +++ b/tests/assembly-llvm/asm/powerpc-types.rs @@ -35,8 +35,6 @@ //@ compile-flags: -Zmerge-functions=disabled -Copt-level=3 //@ compile-flags: --check-cfg=cfg(altivec,vsx,power9,power9be) -// PowerPC `f16` was broken before LLVM 22 -//@ min-llvm-version: 22 #![feature(no_core, f16)] #![cfg_attr(vsx, feature(f128))] diff --git a/tests/assembly-llvm/asm/sparc-types.rs b/tests/assembly-llvm/asm/sparc-types.rs index e7f2d84e470a0..9fabd8dcdd09e 100644 --- a/tests/assembly-llvm/asm/sparc-types.rs +++ b/tests/assembly-llvm/asm/sparc-types.rs @@ -11,7 +11,6 @@ //@[sparc64] filecheck-flags: --check-prefix v9 //@ compile-flags: -Zmerge-functions=disabled -Copt-level=3 //@ compile-flags: --check-cfg=cfg(v9) -//@ min-llvm-version: 22 #![deny(unexpected_cfgs)] #![feature(no_core, asm_experimental_arch, f128)] diff --git a/tests/assembly-llvm/asm/xtensa-types.rs b/tests/assembly-llvm/asm/xtensa-types.rs index 69c22d22b8b9a..9419a78f9e07c 100644 --- a/tests/assembly-llvm/asm/xtensa-types.rs +++ b/tests/assembly-llvm/asm/xtensa-types.rs @@ -1,7 +1,6 @@ //@ add-minicore //@ assembly-output: emit-asm //@ compile-flags: --target xtensa-esp32-none-elf -Zmerge-functions=disabled -//@ min-llvm-version: 22 //@ needs-llvm-components: xtensa #![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)] diff --git a/tests/assembly-llvm/bpf_unaligned.rs b/tests/assembly-llvm/bpf_unaligned.rs index 466c3e411ec2c..ba221fff5bea9 100644 --- a/tests/assembly-llvm/bpf_unaligned.rs +++ b/tests/assembly-llvm/bpf_unaligned.rs @@ -1,7 +1,6 @@ //@ add-minicore //@ assembly-output: emit-asm //@ compile-flags: --target bpfel-unknown-none -C target_feature=+allows-misaligned-mem-access -//@ min-llvm-version: 22 //@ needs-llvm-components: bpf #![feature(no_core)] #![crate_type = "rlib"] diff --git a/tests/assembly-llvm/c-variadic/xtensa.rs b/tests/assembly-llvm/c-variadic/xtensa.rs index a070980cff3d6..31e3c427d4e05 100644 --- a/tests/assembly-llvm/c-variadic/xtensa.rs +++ b/tests/assembly-llvm/c-variadic/xtensa.rs @@ -1,6 +1,5 @@ //@ add-minicore //@ assembly-output: emit-asm -//@ min-llvm-version: 22 // //@ revisions: XTENSA //@ [XTENSA] compile-flags: -Copt-level=3 --target xtensa-esp32-none-elf diff --git a/tests/assembly-llvm/cmse-clear-padding.rs b/tests/assembly-llvm/cmse-clear-padding.rs index 93b10845ea511..271a844a6e82d 100644 --- a/tests/assembly-llvm/cmse-clear-padding.rs +++ b/tests/assembly-llvm/cmse-clear-padding.rs @@ -1,5 +1,4 @@ //@ add-minicore -//@ min-llvm-version: 22 //@ assembly-output: emit-asm //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -Copt-level=1 //@ needs-llvm-components: arm diff --git a/tests/assembly-llvm/tail-call-indirect.rs b/tests/assembly-llvm/tail-call-indirect.rs index 918283966b405..bdebb1f3c30e1 100644 --- a/tests/assembly-llvm/tail-call-indirect.rs +++ b/tests/assembly-llvm/tail-call-indirect.rs @@ -1,5 +1,4 @@ //@ add-minicore -//@ min-llvm-version: 22 //@ assembly-output: emit-asm //@ needs-llvm-components: x86 //@ compile-flags: --target=x86_64-unknown-linux-gnu diff --git a/tests/assembly-llvm/targets/targets-elf.rs b/tests/assembly-llvm/targets/targets-elf.rs index 971e9700035e5..f5c6277ff106c 100644 --- a/tests/assembly-llvm/targets/targets-elf.rs +++ b/tests/assembly-llvm/targets/targets-elf.rs @@ -845,9 +845,6 @@ //@ [xtensa_esp32s3_espidf] compile-flags: --target xtensa-esp32s3-espidf //@ [xtensa_esp32s3_espidf] needs-llvm-components: xtensa -// xtensa support requires a more recent LLVM. -//@ min-llvm-version: 22 - // Sanity-check that each target can produce assembly code. #![feature(no_core, lang_items)] diff --git a/tests/codegen-llvm/amdgpu-addrspacecast.rs b/tests/codegen-llvm/amdgpu-addrspacecast.rs index 144565f7e28ca..0b15c86d9d22b 100644 --- a/tests/codegen-llvm/amdgpu-addrspacecast.rs +++ b/tests/codegen-llvm/amdgpu-addrspacecast.rs @@ -3,23 +3,20 @@ //@ compile-flags: --crate-type=rlib --target=amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 -O //@ needs-llvm-components: amdgpu //@ add-minicore -//@ revisions: LLVM21 LLVM22 -//@ [LLVM21] max-llvm-major-version: 21 -//@ [LLVM22] min-llvm-version: 22 #![feature(no_core)] #![no_core] extern crate minicore; -// Make sure that on LLVM 22, the alloca is passed directly to the lifetime intrinsics, +// Make sure that on LLVM 22+, the alloca is passed directly to the lifetime intrinsics, // not the addrspacecast. // CHECK-LABEL: @ref_of_local // CHECK: [[alloca:%[0-9]]] = alloca // CHECK: %i = addrspacecast ptr addrspace(5) [[alloca]] to ptr -// LLVM22: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[alloca]]) +// CHECK: call void @llvm.lifetime.start.p5(ptr addrspace(5) [[alloca]]) // CHECK: call void %f(ptr{{.*}}%i) -// LLVM22: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[alloca]]) +// CHECK: call void @llvm.lifetime.end.p5(ptr addrspace(5) [[alloca]]) #[no_mangle] pub fn ref_of_local(f: fn(&i32)) { let i = 0; diff --git a/tests/codegen-llvm/const-vector.rs b/tests/codegen-llvm/const-vector.rs index e9e6188f804c0..39492b38f63d4 100644 --- a/tests/codegen-llvm/const-vector.rs +++ b/tests/codegen-llvm/const-vector.rs @@ -1,5 +1,4 @@ //@ revisions: OPT0 OPT0_S390X -//@ min-llvm-version: 22 //@ [OPT0] ignore-s390x //@ [OPT0_S390X] only-s390x //@ [OPT0] compile-flags: -C no-prepopulate-passes -Copt-level=0 diff --git a/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs index 5b100d2cdc381..9115824669f27 100644 --- a/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs +++ b/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs @@ -1,7 +1,4 @@ //@ compile-flags: -Copt-level=3 -//@ revisions: new old -//@ [old] max-llvm-major-version: 21 -//@ [new] min-llvm-version: 22 #![crate_type = "lib"] @@ -25,9 +22,6 @@ pub unsafe fn update(s: *mut State) { // CHECK-NOT: memcpy // CHECK-NOT: 75{{3|4}} - // old: %[[TAG:.+]] = load i8, ptr %s, align 1 - // old-NEXT: and i8 %[[TAG]], 1 - // CHECK-NOT: load // CHECK-NOT: store // CHECK-NOT: memcpy diff --git a/tests/codegen-llvm/pauth/pauth-extern-c-direct-indirect-call.rs b/tests/codegen-llvm/pauth/pauth-extern-c-direct-indirect-call.rs index d01815954b237..b47637a687bb0 100644 --- a/tests/codegen-llvm/pauth/pauth-extern-c-direct-indirect-call.rs +++ b/tests/codegen-llvm/pauth/pauth-extern-c-direct-indirect-call.rs @@ -4,9 +4,6 @@ //@ [O0_PAUTH] needs-llvm-components: aarch64 //@ [O0_PAUTH] compile-flags: --target=aarch64-unknown-linux-pauthtest -C opt-level=0 -// O3_PAUTH relies on an InstCombine fold that removes the redundant `ptrauth` bundle from calls. -// That fold first shipped in LLVM 22, gate this revision accordingly. -//@ [O3_PAUTH] min-llvm-version: 22 //@ [O3_PAUTH] needs-llvm-components: aarch64 //@ [O3_PAUTH] compile-flags: --target=aarch64-unknown-linux-pauthtest -C opt-level=3 diff --git a/tests/codegen-llvm/scalable-vectors/debuginfo.rs b/tests/codegen-llvm/scalable-vectors/debuginfo.rs index 8b2724f06f3e0..1ed7c37a49915 100644 --- a/tests/codegen-llvm/scalable-vectors/debuginfo.rs +++ b/tests/codegen-llvm/scalable-vectors/debuginfo.rs @@ -2,9 +2,6 @@ //@ only-aarch64 //@ only-linux //@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -//@ revisions: POST-LLVM-22 PRE-LLVM-22 -//@ [PRE-LLVM-22] max-llvm-major-version: 21 -//@ [POST-LLVM-22] min-llvm-version: 22 #![crate_type = "lib"] #![allow(incomplete_features, internal_features)] @@ -59,8 +56,7 @@ struct svfloat64_t(f64); #[target_feature(enable = "sve")] pub fn locals() { // CHECK-DAG: name: "svbool_t",{{.*}}, baseType: ![[CT1:[0-9]+]] - // PRE-LLVM-22-DAG: ![[CT1]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTYU8:[0-9]+]],{{.*}}, flags: DIFlagVector, elements: ![[ELTS8:[0-9]+]]) - // POST-LLVM-22-DAG: ![[CT1]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTYU8:[0-9]+]],{{.*}}, flags: DIFlagVector, elements: ![[ELTS8:[0-9]+]], bitStride: i64 1) + // CHECK-DAG: ![[CT1]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTYU8:[0-9]+]],{{.*}}, flags: DIFlagVector, elements: ![[ELTS8:[0-9]+]], bitStride: i64 1) // CHECK-DAG: ![[ELTTYU8]] = !DIBasicType(name: "u8", size: 8, encoding: DW_ATE_unsigned) // CHECK-DAG: ![[ELTS8]] = !{![[REALELTS8:[0-9]+]]} // CHECK-DAG: ![[REALELTS8]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 8, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus)) @@ -71,9 +67,8 @@ pub fn locals() { // CHECK-DAG: ![[ELTTYS8]] = !DIBasicType(name: "i8", size: 8, encoding: DW_ATE_signed) let s8: svint8_t; - // PRE-LLVM-22-DAG: name: "svuint8_t",{{.*}}, baseType: ![[CT1:[0-9]+]] - // POST-LLVM-22-DAG: name: "svuint8_t",{{.*}}, baseType: ![[CT8:[0-9]+]] - // POST-LLVM-22-DAG: ![[CT8]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTYU8]],{{.*}}, flags: DIFlagVector, elements: ![[ELTS8]]) + // CHECK-DAG: name: "svuint8_t",{{.*}}, baseType: ![[CT8:[0-9]+]] + // CHECK-DAG: ![[CT8]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTYU8]],{{.*}}, flags: DIFlagVector, elements: ![[ELTS8]]) let u8: svuint8_t; // CHECK-DAG: name: "svint16_t",{{.*}}, baseType: ![[CT16:[0-9]+]] diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-gather.rs index d79a9cf96ada3..643a3c984332c 100644 --- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-gather.rs +++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-gather.rs @@ -1,9 +1,4 @@ -// - //@ compile-flags: -C no-prepopulate-passes -//@ revisions: LLVM21 LLVM22 -//@ [LLVM22] min-llvm-version: 22 -//@ [LLVM21] max-llvm-major-version: 21 // ignore-tidy-linelength #![crate_type = "lib"] @@ -28,8 +23,7 @@ pub unsafe fn gather_f32x2( ) -> Vec2 { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) - // LLVM22: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) + // CHECK: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) simd_gather(values, pointers, mask) } @@ -42,8 +36,7 @@ pub unsafe fn gather_f32x2_unsigned( ) -> Vec2 { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) - // LLVM22: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) + // CHECK: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) simd_gather(values, pointers, mask) } @@ -56,7 +49,6 @@ pub unsafe fn gather_pf32x2( ) -> Vec2<*const f32> { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x ptr> @llvm.masked.gather.v2p0.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x ptr> {{.*}}) - // LLVM22: call <2 x ptr> @llvm.masked.gather.v2p0.v2p0(<2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]], <2 x ptr> {{.*}}) + // CHECK: call <2 x ptr> @llvm.masked.gather.v2p0.v2p0(<2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]], <2 x ptr> {{.*}}) simd_gather(values, pointers, mask) } diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs index ffe3851c5ad71..e0050431f5b47 100644 --- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs +++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-load.rs @@ -1,7 +1,4 @@ //@ compile-flags: -C no-prepopulate-passes -//@ revisions: LLVM21 LLVM22 -//@ [LLVM22] min-llvm-version: 22 -//@ [LLVM21] max-llvm-major-version: 21 // ignore-tidy-linelength #![crate_type = "lib"] @@ -22,10 +19,7 @@ pub type Vec4 = Simd; pub unsafe fn load_f32x2(mask: Vec2, pointer: *const f32, values: Vec2) -> Vec2 { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> [[B]], <2 x float> {{.*}}) - // ^^^^^ - // LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 4 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) - // ^^^^^^^ + // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 4 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) // the align parameter should be equal to the alignment of the element type (assumed to be 4) simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, pointer, values) } @@ -39,10 +33,7 @@ pub unsafe fn load_f32x2_aligned( ) -> Vec2 { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 8, <2 x i1> [[B]], <2 x float> {{.*}}) - // ^^^^^ - // LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 8 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) - // ^^^^^^^ + // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 8 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) // the align parameter should be equal to the size of the vector simd_masked_load::<_, _, _, { SimdAlign::Vector }>(mask, pointer, values) } @@ -56,10 +47,7 @@ pub unsafe fn load_f32x2_unaligned( ) -> Vec2 { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 1, <2 x i1> [[B]], <2 x float> {{.*}}) - // ^^^^^ - // LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 1 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) - // ^^^^^^^ + // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 1 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) // the align parameter should be 1 simd_masked_load::<_, _, _, { SimdAlign::Unaligned }>(mask, pointer, values) } @@ -73,8 +61,7 @@ pub unsafe fn load_f32x2_unsigned( ) -> Vec2 { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> [[B]], <2 x float> {{.*}}) - // LLVM22: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 4 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) + // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr align 4 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}}) simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, pointer, values) } @@ -87,7 +74,6 @@ pub unsafe fn load_pf32x4( ) -> Vec4<*const f32> { // CHECK: [[A:%[0-9]+]] = lshr <4 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <4 x i32> [[A]] to <4 x i1> - // LLVM21: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr {{.*}}, i32 {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}}) - // LLVM22: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr align {{.*}} {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}}) + // CHECK: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr align {{.*}} {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}}) simd_masked_load::<_, _, _, { SimdAlign::Element }>(mask, pointer, values) } diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs index efeeceec09d12..d9bd214609962 100644 --- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs +++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-masked-store.rs @@ -1,7 +1,4 @@ //@ compile-flags: -C no-prepopulate-passes -//@ revisions: LLVM21 LLVM22 -//@ [LLVM22] min-llvm-version: 22 -//@ [LLVM21] max-llvm-major-version: 21 // ignore-tidy-linelength #![crate_type = "lib"] @@ -22,10 +19,7 @@ pub type Vec4 = Simd; pub unsafe fn store_f32x2(mask: Vec2, pointer: *mut f32, values: Vec2) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 4, <2 x i1> [[B]]) - // ^^^^^ - // LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 4 {{.*}}, <2 x i1> [[B]]) - // ^^^^^^^ + // CHECK: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 4 {{.*}}, <2 x i1> [[B]]) // the align parameter should be equal to the alignment of the element type (assumed to be 4) simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, values) } @@ -35,10 +29,7 @@ pub unsafe fn store_f32x2(mask: Vec2, pointer: *mut f32, values: Vec2) pub unsafe fn store_f32x2_aligned(mask: Vec2, pointer: *mut f32, values: Vec2) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 8, <2 x i1> [[B]]) - // ^^^^^ - // LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 8 {{.*}}, <2 x i1> [[B]]) - // ^^^^^^^ + // CHECK: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 8 {{.*}}, <2 x i1> [[B]]) // the align parameter should be equal to the size of the vector simd_masked_store::<_, _, _, { SimdAlign::Vector }>(mask, pointer, values) } @@ -48,10 +39,7 @@ pub unsafe fn store_f32x2_aligned(mask: Vec2, pointer: *mut f32, values: Ve pub unsafe fn store_f32x2_unaligned(mask: Vec2, pointer: *mut f32, values: Vec2) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 1, <2 x i1> [[B]]) - // ^^^^^ - // LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 1 {{.*}}, <2 x i1> [[B]]) - // ^^^^^^^ + // CHECK: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 1 {{.*}}, <2 x i1> [[B]]) // the align parameter should be 1 simd_masked_store::<_, _, _, { SimdAlign::Unaligned }>(mask, pointer, values) } @@ -61,8 +49,7 @@ pub unsafe fn store_f32x2_unaligned(mask: Vec2, pointer: *mut f32, values: pub unsafe fn store_f32x2_unsigned(mask: Vec2, pointer: *mut f32, values: Vec2) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr {{.*}}, i32 4, <2 x i1> [[B]]) - // LLVM22: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 4 {{.*}}, <2 x i1> [[B]]) + // CHECK: call void @llvm.masked.store.v2f32.p0(<2 x float> {{.*}}, ptr align 4 {{.*}}, <2 x i1> [[B]]) simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, values) } @@ -71,7 +58,6 @@ pub unsafe fn store_f32x2_unsigned(mask: Vec2, pointer: *mut f32, values: V pub unsafe fn store_pf32x4(mask: Vec4, pointer: *mut *const f32, values: Vec4<*const f32>) { // CHECK: [[A:%[0-9]+]] = lshr <4 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <4 x i32> [[A]] to <4 x i1> - // LLVM21: call void @llvm.masked.store.v4p0.p0(<4 x ptr> {{.*}}, ptr {{.*}}, i32 {{.*}}, <4 x i1> [[B]]) - // LLVM22: call void @llvm.masked.store.v4p0.p0(<4 x ptr> {{.*}}, ptr align {{.*}} {{.*}}, <4 x i1> [[B]]) + // CHECK: call void @llvm.masked.store.v4p0.p0(<4 x ptr> {{.*}}, ptr align {{.*}} {{.*}}, <4 x i1> [[B]]) simd_masked_store::<_, _, _, { SimdAlign::Element }>(mask, pointer, values) } diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-scatter.rs index 533fa429ae700..5c6f82d367cf0 100644 --- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-scatter.rs +++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-generic-scatter.rs @@ -1,9 +1,4 @@ -// - //@ compile-flags: -C no-prepopulate-passes -//@ revisions: LLVM21 LLVM22 -//@ [LLVM22] min-llvm-version: 22 -//@ [LLVM21] max-llvm-major-version: 21 // ignore-tidy-linelength #![crate_type = "lib"] @@ -24,8 +19,7 @@ pub type Vec4 = Simd; pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2, values: Vec2) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]] - // LLVM22: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]] + // CHECK: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]] simd_scatter(values, pointers, mask) } @@ -34,8 +28,7 @@ pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2, values: V pub unsafe fn scatter_f32x2_unsigned(pointers: Vec2<*mut f32>, mask: Vec2, values: Vec2) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]] - // LLVM22: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]] + // CHECK: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]] simd_scatter(values, pointers, mask) } @@ -48,7 +41,6 @@ pub unsafe fn scatter_pf32x2( ) { // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{|splat \(i32 31\)}} // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1> - // LLVM21: call void @llvm.masked.scatter.v2p0.v2p0(<2 x ptr> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]] - // LLVM22: call void @llvm.masked.scatter.v2p0.v2p0(<2 x ptr> {{.*}}, <2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]] + // CHECK: call void @llvm.masked.scatter.v2p0.v2p0(<2 x ptr> {{.*}}, <2 x ptr> align {{.*}} {{.*}}, <2 x i1> [[B]] simd_scatter(values, pointers, mask) } diff --git a/tests/codegen-llvm/slp-vectorization-mul3.rs b/tests/codegen-llvm/slp-vectorization-mul3.rs index 38c0949b82713..1c40c6b28f3ff 100644 --- a/tests/codegen-llvm/slp-vectorization-mul3.rs +++ b/tests/codegen-llvm/slp-vectorization-mul3.rs @@ -1,7 +1,6 @@ //! Regression test for #142519 //@ only-x86_64 //@ compile-flags: -O -//@ min-llvm-version: 22 #![crate_type = "lib"] diff --git a/tests/codegen-llvm/store-captures.rs b/tests/codegen-llvm/store-captures.rs index 33d24032ee450..24cbb91cf29ee 100644 --- a/tests/codegen-llvm/store-captures.rs +++ b/tests/codegen-llvm/store-captures.rs @@ -1,4 +1,3 @@ -//@ min-llvm-version: 22 //@ compile-flags: -O -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/tests/codegen-llvm/tail-call-u128.rs b/tests/codegen-llvm/tail-call-u128.rs index 25dfc47a2bfec..b3aab7d93d46c 100644 --- a/tests/codegen-llvm/tail-call-u128.rs +++ b/tests/codegen-llvm/tail-call-u128.rs @@ -1,6 +1,5 @@ //@ add-minicore //@ revisions: win linux -//@ min-llvm-version: 22 // //@ compile-flags: -Copt-level=3 //@[linux] compile-flags: --target x86_64-unknown-linux-gnu diff --git a/tests/codegen-llvm/vec_pop_push_noop.rs b/tests/codegen-llvm/vec_pop_push_noop.rs index 977c220b3baef..9bfc77eaa6fa3 100644 --- a/tests/codegen-llvm/vec_pop_push_noop.rs +++ b/tests/codegen-llvm/vec_pop_push_noop.rs @@ -1,7 +1,4 @@ //@ compile-flags: -Copt-level=3 -//@ revisions: new old -//@ [old] max-llvm-major-version: 21 -//@ [new] min-llvm-version: 22 #![crate_type = "lib"] @@ -10,7 +7,6 @@ pub fn noop(v: &mut Vec) { // CHECK-NOT: grow_one // CHECK-NOT: call - // old: tail call void @llvm.assume // CHECK-NOT: grow_one // CHECK-NOT: call // CHECK: {{ret|[}]}} diff --git a/tests/codegen-llvm/vecdeque_pop_push.rs b/tests/codegen-llvm/vecdeque_pop_push.rs index 6f9ad6674d6cd..7545a0b2e39c3 100644 --- a/tests/codegen-llvm/vecdeque_pop_push.rs +++ b/tests/codegen-llvm/vecdeque_pop_push.rs @@ -1,7 +1,4 @@ //@ compile-flags: -Copt-level=3 -//@ revisions: new old -//@ [old] max-llvm-major-version: 21 -//@ [new] min-llvm-version: 22 #![crate_type = "lib"] @@ -11,7 +8,6 @@ use std::collections::VecDeque; // CHECK-LABEL: @noop_back( pub fn noop_back(v: &mut VecDeque) { // CHECK-NOT: grow - // old: tail call void @llvm.assume // CHECK-NOT: grow // CHECK: ret if let Some(x) = v.pop_back() { diff --git a/tests/ui/codegen/huge-stacks.rs b/tests/ui/codegen/huge-stacks.rs index 790de95eb7416..f661d8728be1f 100644 --- a/tests/ui/codegen/huge-stacks.rs +++ b/tests/ui/codegen/huge-stacks.rs @@ -2,7 +2,6 @@ //@[optimized]compile-flags: -O //@ run-pass //@ only-64bit -//@ min-llvm-version: 22 // Regression test for https://github.com/rust-lang/rust/issues/83060 // Verifies a program is not miscompiled if it includes a 4GB array on the stack diff --git a/tests/ui/explicit-tail-calls/no-unsized-arguments.aarch64.stderr b/tests/ui/explicit-tail-calls/no-unsized-arguments.aarch64.stderr index 33e190e1a4a7f..31ceec9afe081 100644 --- a/tests/ui/explicit-tail-calls/no-unsized-arguments.aarch64.stderr +++ b/tests/ui/explicit-tail-calls/no-unsized-arguments.aarch64.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> $DIR/no-unsized-arguments.rs:40:42 + --> $DIR/no-unsized-arguments.rs:39:42 | LL | extern "tail" fn unsized_argument(x: [u8]) -> u8 { | ^^^^ doesn't have a size known at compile-time @@ -11,7 +11,7 @@ LL | extern "tail" fn unsized_argument(x: &[u8]) -> u8 { | + error: unsized arguments cannot be used in a tail call - --> $DIR/no-unsized-arguments.rs:33:5 + --> $DIR/no-unsized-arguments.rs:32:5 | LL | become unsized_argument(b); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | become unsized_argument(b); = note: unsized argument of type `[u8]` error: unsized arguments cannot be used in a tail call - --> $DIR/no-unsized-arguments.rs:48:5 + --> $DIR/no-unsized-arguments.rs:47:5 | LL | become unsized_argument(*b); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/explicit-tail-calls/no-unsized-arguments.rs b/tests/ui/explicit-tail-calls/no-unsized-arguments.rs index a0c5b53d8df0c..76a9a59c51a15 100644 --- a/tests/ui/explicit-tail-calls/no-unsized-arguments.rs +++ b/tests/ui/explicit-tail-calls/no-unsized-arguments.rs @@ -1,6 +1,5 @@ //@ add-minicore //@ ignore-backends: gcc -//@ min-llvm-version: 22 // //@ revisions: x86 x86_64 aarch64 // diff --git a/tests/ui/explicit-tail-calls/no-unsized-arguments.x86.stderr b/tests/ui/explicit-tail-calls/no-unsized-arguments.x86.stderr index 33e190e1a4a7f..31ceec9afe081 100644 --- a/tests/ui/explicit-tail-calls/no-unsized-arguments.x86.stderr +++ b/tests/ui/explicit-tail-calls/no-unsized-arguments.x86.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> $DIR/no-unsized-arguments.rs:40:42 + --> $DIR/no-unsized-arguments.rs:39:42 | LL | extern "tail" fn unsized_argument(x: [u8]) -> u8 { | ^^^^ doesn't have a size known at compile-time @@ -11,7 +11,7 @@ LL | extern "tail" fn unsized_argument(x: &[u8]) -> u8 { | + error: unsized arguments cannot be used in a tail call - --> $DIR/no-unsized-arguments.rs:33:5 + --> $DIR/no-unsized-arguments.rs:32:5 | LL | become unsized_argument(b); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | become unsized_argument(b); = note: unsized argument of type `[u8]` error: unsized arguments cannot be used in a tail call - --> $DIR/no-unsized-arguments.rs:48:5 + --> $DIR/no-unsized-arguments.rs:47:5 | LL | become unsized_argument(*b); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/explicit-tail-calls/no-unsized-arguments.x86_64.stderr b/tests/ui/explicit-tail-calls/no-unsized-arguments.x86_64.stderr index 33e190e1a4a7f..31ceec9afe081 100644 --- a/tests/ui/explicit-tail-calls/no-unsized-arguments.x86_64.stderr +++ b/tests/ui/explicit-tail-calls/no-unsized-arguments.x86_64.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> $DIR/no-unsized-arguments.rs:40:42 + --> $DIR/no-unsized-arguments.rs:39:42 | LL | extern "tail" fn unsized_argument(x: [u8]) -> u8 { | ^^^^ doesn't have a size known at compile-time @@ -11,7 +11,7 @@ LL | extern "tail" fn unsized_argument(x: &[u8]) -> u8 { | + error: unsized arguments cannot be used in a tail call - --> $DIR/no-unsized-arguments.rs:33:5 + --> $DIR/no-unsized-arguments.rs:32:5 | LL | become unsized_argument(b); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | become unsized_argument(b); = note: unsized argument of type `[u8]` error: unsized arguments cannot be used in a tail call - --> $DIR/no-unsized-arguments.rs:48:5 + --> $DIR/no-unsized-arguments.rs:47:5 | LL | become unsized_argument(*b); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/explicit-tail-calls/support/basic.rs b/tests/ui/explicit-tail-calls/support/basic.rs index d46dd726c0bd1..eb3041f106171 100644 --- a/tests/ui/explicit-tail-calls/support/basic.rs +++ b/tests/ui/explicit-tail-calls/support/basic.rs @@ -1,7 +1,6 @@ //@ build-pass //@ ignore-backends: gcc //@ add-minicore -//@ min-llvm-version: 22 // //@ revisions: i686 //@[i686] compile-flags: --target i686-unknown-linux-gnu diff --git a/tests/ui/explicit-tail-calls/support/bystack.rs b/tests/ui/explicit-tail-calls/support/bystack.rs index c89ad194f8ba1..8a9aa72bb5636 100644 --- a/tests/ui/explicit-tail-calls/support/bystack.rs +++ b/tests/ui/explicit-tail-calls/support/bystack.rs @@ -1,7 +1,6 @@ //@ build-pass //@ ignore-backends: gcc //@ add-minicore -//@ min-llvm-version: 22 // //@ revisions: i686 //@[i686] compile-flags: --target i686-unknown-linux-gnu @@ -33,6 +32,9 @@ //@ revisions: powerpc64 //@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu //@[powerpc64] needs-llvm-components: powerpc +// +// loongarch disabled musttail in LLVM 22, didn't come back in LLVM 23 +// //@ revisions: loongarch32 //@[loongarch32] compile-flags: --target loongarch32-unknown-none //@[loongarch32] needs-llvm-components: loongarch @@ -41,6 +43,7 @@ //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu //@[loongarch64] needs-llvm-components: loongarch //@[loongarch64] max-llvm-major-version: 21 +// //@ revisions: bpf //@[bpf] compile-flags: --target bpfeb-unknown-none //@[bpf] needs-llvm-components: bpf @@ -51,11 +54,12 @@ //@[nvptx64] compile-flags: --target nvptx64-nvidia-cuda //@[nvptx64] needs-llvm-components: nvptx // -// Riscv does not support byval in LLVM 22 (but wil in LLVM 23) +// Riscv does not support byval in LLVM 22 (but does in LLVM 23+) // -// //@ revisions: riscv -// //@[riscv] compile-flags: --target riscv64gc-unknown-linux-gnu -// //@[riscv] needs-llvm-components: riscv +//@ revisions: riscv +//@[riscv] compile-flags: --target riscv64gc-unknown-linux-gnu +//@[riscv] needs-llvm-components: riscv +//@[riscv] min-llvm-version: 23 // // Wasm needs a special target feature. // diff --git a/tests/ui/explicit-tail-calls/support/byval.rs b/tests/ui/explicit-tail-calls/support/byval.rs index e6f26b9292eb6..cea5f5a51aa9e 100644 --- a/tests/ui/explicit-tail-calls/support/byval.rs +++ b/tests/ui/explicit-tail-calls/support/byval.rs @@ -1,7 +1,6 @@ //@ build-pass //@ ignore-backends: gcc //@ add-minicore -//@ min-llvm-version: 22 // //@ revisions: i686 //@[i686] compile-flags: --target i686-unknown-linux-gnu @@ -33,6 +32,9 @@ //@ revisions: powerpc64 //@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu //@[powerpc64] needs-llvm-components: powerpc +// +// loongarch dropped support for musttail in LLVM 22 and it didn't come back in 23 +// //@ revisions: loongarch32 //@[loongarch32] compile-flags: --target loongarch32-unknown-none //@[loongarch32] needs-llvm-components: loongarch @@ -41,6 +43,7 @@ //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu //@[loongarch64] needs-llvm-components: loongarch //@[loongarch64] max-llvm-major-version: 21 +// //@ revisions: bpf //@[bpf] compile-flags: --target bpfeb-unknown-none //@[bpf] needs-llvm-components: bpf @@ -51,11 +54,12 @@ //@[nvptx64] compile-flags: --target nvptx64-nvidia-cuda //@[nvptx64] needs-llvm-components: nvptx // -// Riscv does not support byval in LLVM 22 (but wil in LLVM 23) +// Riscv does not support byval in LLVM 22 (but does in LLVM 23+) // -// //@ revisions: riscv -// //@[riscv] compile-flags: --target riscv64gc-unknown-linux-gnu -// //@[riscv] needs-llvm-components: riscv +//@ revisions: riscv +//@[riscv] compile-flags: --target riscv64gc-unknown-linux-gnu +//@[riscv] needs-llvm-components: riscv +//@[riscv] min-llvm-version: 23 // // Wasm needs a special target feature. // diff --git a/tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs b/tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs index e9d6a35e0ab30..f08218fdae7f6 100644 --- a/tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs +++ b/tests/ui/feature-gates/feature-gate-xtensa-target-feature.rs @@ -1,6 +1,5 @@ //@ add-minicore //@ needs-llvm-components: xtensa -//@ min-llvm-version: 22 //@ compile-flags: --target=xtensa-esp32-none-elf --crate-type=rlib //@ ignore-backends: gcc #![no_core] diff --git a/tests/ui/feature-gates/feature-gate-xtensa-target-feature.stderr b/tests/ui/feature-gates/feature-gate-xtensa-target-feature.stderr index 1854fbb3de4d2..d8dc56900f8f8 100644 --- a/tests/ui/feature-gates/feature-gate-xtensa-target-feature.stderr +++ b/tests/ui/feature-gates/feature-gate-xtensa-target-feature.stderr @@ -1,5 +1,5 @@ error[E0658]: the target feature `bool` is currently unstable - --> $DIR/feature-gate-xtensa-target-feature.rs:12:18 + --> $DIR/feature-gate-xtensa-target-feature.rs:11:18 | LL | #[target_feature(enable = "bool")] | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/float/minmax.rs b/tests/ui/float/minmax.rs deleted file mode 100644 index e6bac901d7922..0000000000000 --- a/tests/ui/float/minmax.rs +++ /dev/null @@ -1,22 +0,0 @@ -//FIXME(llvm21) This should be a library test, but old LLVM miscompiles things so we can't just -// test this properly everywhere. Once we require LLVM 22, remove this test and enable the -// commented-out tests in `library/coretests/tests/floats/mod.rs` instead. -//@ min-llvm-version: 22 -//@ run-pass - -use std::hint::black_box; - -const SNAN32: f32 = f32::from_bits(f32::NAN.to_bits() - 1); -const SNAN64: f64 = f64::from_bits(f64::NAN.to_bits() - 1); - -fn main() { - assert_eq!(SNAN32.min(black_box(9.0)), 9.0f32); - assert_eq!(black_box(SNAN32).min(-9.0), -9.0f32); - assert_eq!((9.0f32).min(black_box(SNAN32)), 9.0f32); - assert_eq!(black_box(-9.0f32).min(SNAN32), -9.0f32); - - assert_eq!(SNAN64.min(black_box(9.0)), 9.0f64); - assert_eq!(black_box(SNAN64).min(-9.0), -9.0f64); - assert_eq!((9.0f64).min(black_box(SNAN64)), 9.0f64); - assert_eq!(black_box(-9.0f64).min(SNAN64), -9.0f64); -}