This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Strip TLS when "atomics" is not enabled
ClosedPublic

Authored by sunfish on May 16 2022, 3:36 PM.

Details

Summary

With f3b4f99007cdcb3306484c9a39d31addc20aaa69, the exclusive source of truth for whether threads are supported is the -matomics flag. Accordingly, strip TLS flags when -matomic is not specified, even if bulk-memory is specified and it would theoretically be supportable. This allows the backend to compile TLS variables when -mbulk-memory is enabled but threads are not enabled.

Diff Detail

Event Timeline

sunfish created this revision.May 16 2022, 3:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 3:36 PM
sunfish requested review of this revision.May 16 2022, 3:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 3:36 PM
Herald added a subscriber: aheejin. · View Herald Transcript
sbc100 accepted this revision.May 17 2022, 9:39 PM

The addition of -mcpu seem seperate to the TLS issue.. maybe it can land separately? I wonder if we should rename or alias mvp to something more widely understandable such as v1 ?

llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
207–208

Why not else if here and avoid running stripThreadLocals twice?

This revision is now accepted and ready to land.May 17 2022, 9:39 PM

I think I've got a test case pending that actually needs this change.. can this be landed?

This revision was landed with ongoing or failed builds.May 20 2022, 3:20 PM
This revision was automatically updated to reflect the committed changes.