-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
rust/src/libcore/sync/atomic.rs
Lines 2422 to 2440 in 6576f4b
#[cfg_attr(target_arch = "wasm32", allow(unused_variables))] | |
pub fn fence(order: Ordering) { | |
// On wasm32 it looks like fences aren't implemented in LLVM yet in that | |
// they will cause LLVM to abort. The wasm instruction set doesn't have | |
// fences right now. There's discussion online about the best way for tools | |
// to conventionally implement fences at | |
// https://github.com/WebAssembly/tool-conventions/issues/59. We should | |
// follow that discussion and implement a solution when one comes about! | |
#[cfg(not(target_arch = "wasm32"))] | |
unsafe { | |
match order { | |
Acquire => intrinsics::atomic_fence_acq(), | |
Release => intrinsics::atomic_fence_rel(), | |
AcqRel => intrinsics::atomic_fence_acqrel(), | |
SeqCst => intrinsics::atomic_fence(), | |
Relaxed => panic!("there is no such thing as a relaxed fence"), | |
} | |
} | |
} |
The comment says that the issue should be watched, but it has been closed for 2 months now with an implementation for wasm32 at llvm/llvm-project@d85fd5a
The branch rust uses doesn't include that commit yet (llvm/llvm-project@d85fd5a), but it's available.
Maybe llvm can be updated and the config attributes removed?
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.