Skip to content

Commit 05f7b7b

Browse files
authored
Rollup merge of rust-lang#140660 - RalfJung:more-order, r=WaffleLapkin
remove 'unordered' atomic intrinsics As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see rust-lang/compiler-builtins#788).
2 parents d33d514 + 79dfd0a commit 05f7b7b

File tree

5 files changed

+1
-16
lines changed

5 files changed

+1
-16
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,6 @@ impl ToGccOrdering for AtomicOrdering {
24542454
use MemOrdering::*;
24552455

24562456
let ordering = match self {
2457-
AtomicOrdering::Unordered => __ATOMIC_RELAXED,
24582457
AtomicOrdering::Relaxed => __ATOMIC_RELAXED, // TODO(antoyo): check if that's the same.
24592458
AtomicOrdering::Acquire => __ATOMIC_ACQUIRE,
24602459
AtomicOrdering::Release => __ATOMIC_RELEASE,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ impl AtomicRmwBinOp {
415415
pub(crate) enum AtomicOrdering {
416416
#[allow(dead_code)]
417417
NotAtomic = 0,
418+
#[allow(dead_code)]
418419
Unordered = 1,
419420
Monotonic = 2,
420421
// Consume = 3, // Not specified yet.
@@ -428,7 +429,6 @@ impl AtomicOrdering {
428429
pub(crate) fn from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self {
429430
use rustc_codegen_ssa::common::AtomicOrdering as Common;
430431
match ao {
431-
Common::Unordered => Self::Unordered,
432432
Common::Relaxed => Self::Monotonic,
433433
Common::Acquire => Self::Acquire,
434434
Common::Release => Self::Release,

compiler/rustc_codegen_ssa/src/common.rs

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ pub enum AtomicRmwBinOp {
6161

6262
#[derive(Copy, Clone, Debug)]
6363
pub enum AtomicOrdering {
64-
Unordered,
6564
Relaxed,
6665
Acquire,
6766
Release,

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
336336
};
337337

338338
let parse_ordering = |bx: &Bx, s| match s {
339-
"unordered" => Unordered,
340339
"relaxed" => Relaxed,
341340
"acquire" => Acquire,
342341
"release" => Release,

library/core/src/intrinsics/mod.rs

-12
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,6 @@ pub unsafe fn atomic_load_acquire<T: Copy>(src: *const T) -> T;
430430
#[rustc_intrinsic]
431431
#[rustc_nounwind]
432432
pub unsafe fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
433-
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
434-
/// In terms of the Rust Abstract Machine, this operation is equivalent to `src.read()`,
435-
/// i.e., it performs a non-atomic read.
436-
#[rustc_intrinsic]
437-
#[rustc_nounwind]
438-
pub unsafe fn atomic_load_unordered<T: Copy>(src: *const T) -> T;
439433

440434
/// Stores the value at the specified memory location.
441435
/// `T` must be an integer or pointer type.
@@ -464,12 +458,6 @@ pub unsafe fn atomic_store_release<T: Copy>(dst: *mut T, val: T);
464458
#[rustc_intrinsic]
465459
#[rustc_nounwind]
466460
pub unsafe fn atomic_store_relaxed<T: Copy>(dst: *mut T, val: T);
467-
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
468-
/// In terms of the Rust Abstract Machine, this operation is equivalent to `dst.write(val)`,
469-
/// i.e., it performs a non-atomic write.
470-
#[rustc_intrinsic]
471-
#[rustc_nounwind]
472-
pub unsafe fn atomic_store_unordered<T: Copy>(dst: *mut T, val: T);
473461

474462
/// Stores the value at the specified memory location, returning the old value.
475463
/// `T` must be an integer or pointer type.

0 commit comments

Comments
 (0)