[clang] [lld] [llvm] [WebAssembly] WASIP3 and component model threading support (PR #175800)
Sy Brand via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 20 01:06:34 PST 2026
================
@@ -407,10 +418,11 @@ WebAssemblyTargetInfo::getTargetBuiltins() const {
void WebAssemblyTargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts,
const TargetInfo *Aux) {
TargetInfo::adjust(Diags, Opts, Aux);
- // Turn off POSIXThreads and ThreadModel so that we don't predefine _REENTRANT
- // or __STDCPP_THREADS__ if we will eventually end up stripping atomics
- // because they are unsupported.
- if (!HasAtomics || !HasBulkMemory) {
+ // If not using component model threading intrinsics, turn off POSIXThreads
+ // and ThreadModel so that we don't predefine _REENTRANT or __STDCPP_THREADS__
+ // if we will eventually end up stripping atomics because they are unsupported.
+ if (!HasComponentModelThreadContext &&
+ (!HasAtomics || !HasBulkMemory)) {
----------------
TartanLlama wrote:
Yeah I don't see a strong reason to disallow it. Maybe you're compiling some code that uses atomics and targeting WASIp3; the operations don't *need* to be atomic, but we shouldn't necessitate making code changes just to save them cycles
https://github.com/llvm/llvm-project/pull/175800
More information about the llvm-commits
mailing list