Skip to content

remove 'unordered' atomic intrinsics #140660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_codegen_gcc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2454,7 +2454,6 @@ impl ToGccOrdering for AtomicOrdering {
use MemOrdering::*;

let ordering = match self {
AtomicOrdering::Unordered => __ATOMIC_RELAXED,
AtomicOrdering::Relaxed => __ATOMIC_RELAXED, // TODO(antoyo): check if that's the same.
AtomicOrdering::Acquire => __ATOMIC_ACQUIRE,
AtomicOrdering::Release => __ATOMIC_RELEASE,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ impl AtomicRmwBinOp {
pub(crate) enum AtomicOrdering {
#[allow(dead_code)]
NotAtomic = 0,
#[allow(dead_code)]
Unordered = 1,
Monotonic = 2,
// Consume = 3, // Not specified yet.
Expand All @@ -428,7 +429,6 @@ impl AtomicOrdering {
pub(crate) fn from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self {
use rustc_codegen_ssa::common::AtomicOrdering as Common;
match ao {
Common::Unordered => Self::Unordered,
Common::Relaxed => Self::Monotonic,
Common::Acquire => Self::Acquire,
Common::Release => Self::Release,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ pub enum AtomicRmwBinOp {

#[derive(Copy, Clone, Debug)]
pub enum AtomicOrdering {
Unordered,
Relaxed,
Acquire,
Release,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
};

let parse_ordering = |bx: &Bx, s| match s {
"unordered" => Unordered,
"relaxed" => Relaxed,
"acquire" => Acquire,
"release" => Release,
Expand Down
12 changes: 0 additions & 12 deletions library/core/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,6 @@ pub unsafe fn atomic_load_acquire<T: Copy>(src: *const T) -> T;
#[rustc_intrinsic]
#[rustc_nounwind]
pub unsafe fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
/// In terms of the Rust Abstract Machine, this operation is equivalent to `src.read()`,
/// i.e., it performs a non-atomic read.
#[rustc_intrinsic]
#[rustc_nounwind]
pub unsafe fn atomic_load_unordered<T: Copy>(src: *const T) -> T;

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

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