[PATCH] D130050: [WebAssembly] Use `localexec` as default TLS model

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 16:32:16 PDT 2022


sbc100 added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1725
+  // to override this default with `-ftls-model=...` and/or
+  // __attribute__((tls_model("...")))`.
   const GlobalValue *GV = GA->getGlobal();
----------------
We should only make this assumption if `!Subtarget->getTargetTriple().isOSEmscripten()` because emscripten *does* support dynamic linking (and dynamic linking + threads at the same time!).

How about removing the assertion and instead doing something like this:

```
// Non-emscripten target currently don't support any kind of dynamic linking
// so we can treat all TLS as LocalExecTLSModel
auto model = Subtarget->getTargetTriple().isOSEmscripten() ? GV->getThreadLocalMode() : LocalExecTLSModel;
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130050/new/

https://reviews.llvm.org/D130050



More information about the llvm-commits mailing list