[all-commits] [llvm/llvm-project] 14f451: [clang][WeAssembly] Do not override thread model w...

Derek Schuff via All-commits all-commits at lists.llvm.org
Fri Sep 25 08:48:54 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 14f451262dc753b53f79a103744dd6988894467f
      https://github.com/llvm/llvm-project/commit/14f451262dc753b53f79a103744dd6988894467f
  Author: Derek Schuff <dschuff at chromium.org>
  Date:   2026-09-25 (Fri, 25 Sep 2026)

  Changed paths:
    M clang/lib/Basic/Targets/WebAssembly.cpp
    M clang/lib/Basic/Targets/WebAssembly.h
    M clang/test/CodeGen/thread-model.c
    M clang/test/CodeGenCXX/static-init-wasm.cpp
    M clang/test/Preprocessor/init.c
    M llvm/lib/Target/WebAssembly/WebAssemblyCoalesceFeaturesAndStripAtomics.cpp
    M llvm/lib/TargetParser/Triple.cpp
    R llvm/test/CodeGen/WebAssembly/coalesce-features-thread-model.ll

  Log Message:
  -----------
  [clang][WeAssembly] Do not override thread model when building without atomics (#225981)

This change does 2 things. The first is to revert #223917, setting the
Triple's
default thread model back to posix. The second is to stop overriding it
when
atomics are not enabled.

This means that compiles with no thread- or atomics-related flags will
get the default posix thread model, independently of whether they get
_REENTRANT defined or the atomics feature is enabled. Practically this
means that the thread model will always be posix unless explicitly
overridden at the driver command line.

The leftover setting of Opts.POSIXThreads became a no-op when used
with the clang driver because the logic would only activate when
-pthread
was not already used (since the driver has separate logic linking
several
flags together).

This is a safer version of the status quo before the thread-model
module flag was introduced, because atomics are still lowered
in the same way but there is no risk of unsafe initialization
or LICM in such scenarios. We could probably further simplify
the interaction between various thread- and atomics-related
flags and thread agnosticism, but this is a small step
that fixes a known hazard.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list