Skip to content
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

remove element_unordered_atomic intrinsics #789

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Mar 12, 2025

It is not clear how these "unordered" operations are supposed to fit the memory model. The intrinsics used here are labeled with "DO NOT USE" in the docs. The plan in rust-lang/rfcs#3301 and for C++, as I understand it, is to have "bytewise atomic memcpy" with the usual orderings: SeqCst, Release, Acquire, Relaxed. These "unordered" intrinsics seem to be a dead end.

These intrinsics are also unused as far as I can tell; rust-lang/rust#59155 which planned to use them never landed.

Part of #788.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. It seems like these are emitted from https://llvm.org/docs/LangRef.html#element-wise-atomic-memory-intrinsics, but if we aren't using that and C++ also has no way to represent these operations, doesn't seem likely that anybody can actually be expecting them to be available.

@tgross35 tgross35 force-pushed the element_unordered_atomic branch from b4b44c6 to 168dbf0 Compare March 18, 2025 00:19
@tgross35 tgross35 enabled auto-merge (rebase) March 18, 2025 00:19
@tgross35 tgross35 merged commit 04ec5de into rust-lang:master Mar 18, 2025
26 checks passed
tgross35 added a commit to tgross35/rust that referenced this pull request Mar 20, 2025
Includes the following changes related to unordered atomics:

* Remove element_unordered_atomic intrinsics [1]
* Remove use of `atomic_load_unordered` and undefined behaviour [2]

There are a handful of other small changes, but nothing else
user-visible.

[1]: rust-lang/compiler-builtins#789
[2]: rust-lang/compiler-builtins#790
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants