Skip to content

Commit 0184a8c

Browse files
committed
check if minimumnum works with LLVM 21
1 parent 5d90f0c commit 0184a8c

2 files changed

Lines changed: 9 additions & 22 deletions

File tree

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
192192
| sym::maximum_number_nsz_f16
193193
| sym::maximum_number_nsz_f32
194194
| sym::maximum_number_nsz_f64
195-
| sym::maximum_number_nsz_f128
196-
// Need at least LLVM 22 for `min/maximumnum` to not crash LLVM.
197-
if crate::llvm_util::get_version() >= (22, 0, 0) =>
198-
{
195+
| sym::maximum_number_nsz_f128 => {
199196
let intrinsic_name = if name.as_str().starts_with("min") {
200197
"llvm.minimumnum"
201198
} else {

library/coretests/tests/floats/mod.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -687,15 +687,10 @@ float_test! {
687687
assert_biteq!(flt(9.0).min(black_box(Float::NAN)), 9.0);
688688
assert_biteq!(black_box(flt(-9.0)).min(Float::NAN), -9.0);
689689
assert!(Float::NAN.min(Float::NAN).is_nan());
690-
// FIXME(llvm21): LLVM miscompiles the fallback impl on aarch64 and likely other targets
691-
// (https://github.com/llvm/llvm-project/issues/176624). When we require LLVM 22,
692-
// remove the ui test `tests/ui/float/minmax.rs` and unconditionally enable the test here.
693-
if cfg!(miri) {
694-
assert_biteq!(Float::SNAN.min(black_box(9.0)), 9.0);
695-
assert_biteq!(black_box(Float::SNAN).min(-9.0), -9.0);
696-
assert_biteq!(flt(9.0).min(black_box(Float::SNAN)), 9.0);
697-
assert_biteq!(black_box(flt(-9.0)).min(Float::SNAN), -9.0);
698-
}
690+
assert_biteq!(Float::SNAN.min(black_box(9.0)), 9.0);
691+
assert_biteq!(black_box(Float::SNAN).min(-9.0), -9.0);
692+
assert_biteq!(flt(9.0).min(black_box(Float::SNAN)), 9.0);
693+
assert_biteq!(black_box(flt(-9.0)).min(Float::SNAN), -9.0);
699694
assert!(Float::SNAN.min(Float::SNAN).is_nan());
700695
}
701696
}
@@ -729,15 +724,10 @@ float_test! {
729724
assert_biteq!(flt(9.0).max(black_box(Float::NAN)), 9.0);
730725
assert_biteq!(black_box(flt(-9.0)).max(Float::NAN), -9.0);
731726
assert!(Float::NAN.max(Float::NAN).is_nan());
732-
// FIXME(llvm21): LLVM miscompiles the fallback impl on aarch64 and likely other targets
733-
// (https://github.com/llvm/llvm-project/issues/176624). When we require LLVM 22,
734-
// remove the ui test `tests/ui/float/minmax.rs` and unconditionally enable the test here.
735-
if cfg!(miri) {
736-
assert_biteq!(Float::SNAN.max(black_box(9.0)), 9.0);
737-
assert_biteq!(black_box(Float::SNAN).max(-9.0), -9.0);
738-
assert_biteq!(flt(9.0).max(black_box(Float::SNAN)), 9.0);
739-
assert_biteq!(black_box(flt(-9.0)).max(Float::SNAN), -9.0);
740-
}
727+
assert_biteq!(Float::SNAN.max(black_box(9.0)), 9.0);
728+
assert_biteq!(black_box(Float::SNAN).max(-9.0), -9.0);
729+
assert_biteq!(flt(9.0).max(black_box(Float::SNAN)), 9.0);
730+
assert_biteq!(black_box(flt(-9.0)).max(Float::SNAN), -9.0);
741731
assert!(Float::SNAN.max(Float::SNAN).is_nan());
742732
}
743733
}

0 commit comments

Comments
 (0)