This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Use `localexec` as default TLS model
AbandonedPublic

Authored by abrown on Jul 18 2022, 4:15 PM.

Details

Reviewers
None
Summary

When compiling to the WebAssembly target, there is currently

Diff Detail

Event Timeline

abrown created this revision.Jul 18 2022, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 4:15 PM
abrown requested review of this revision.Jul 18 2022, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 4:15 PM
abrown abandoned this revision.Jul 18 2022, 4:26 PM

Re-submitting...

sbc100 added inline comments.Jul 18 2022, 4:32 PM
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
1725

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;