================
@@ -283,10 +283,17 @@ class CoalesceFeaturesAndStripAtomics final : public 
ModulePass {
     bool StrippedAtomics = false;
     bool StrippedTLS = false;
 
+    // In cooperative threading mode, thread locals are meaningful even without
+    // atomics.
+    bool CooperativeThreading =
+        WasmTM->getSubtargetImpl()->hasCooperativeMultithreading();
+
     if (!Features[WebAssembly::FeatureAtomics]) {
       StrippedAtomics = stripAtomics(M);
-      StrippedTLS = stripThreadLocals(M);
-    } else if (!Features[WebAssembly::FeatureBulkMemory]) {
+      if (!CooperativeThreading)
+        StrippedTLS = stripThreadLocals(M);
+    }
+    if (!Features[WebAssembly::FeatureBulkMemory]) {
----------------
TartanLlama wrote:

The only difference in behaviour is in the `CooperativeThreading` case, which 
now does not strip thread locals in the `!atomics` case, but still does in the 
`!bulk_memory` case. The latter was the reason for removing the `else`. 

https://github.com/llvm/llvm-project/pull/200855
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to