[PATCH] D59625: [WebAssembly] Set "atomics" linkage depending on stripped ops or tls

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 18:57:21 PDT 2019


tlively created this revision.
tlively added reviewers: aheejin, sbc100, dschuff.
Herald added subscribers: llvm-commits, jfb, sunfish, hiraditya, jgravelle-google.
Herald added a project: LLVM.

When atomics are not enabled, detect whether there exists any atomic
operations or thread local storage that will be stripped. Disallow
linking with objects that contain atomics if and only if atomics or
tls are stripped. When atomics is enabled, mark it as used but do not
require it of other objects in the link. These changes allow libraries
that do not use atomics to be built once and linked into both
single-threaded and multithreaded binaries.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59625

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
  llvm/test/CodeGen/WebAssembly/target-features-atomics.ll
  llvm/test/CodeGen/WebAssembly/target-features-tls.ll
  llvm/test/CodeGen/WebAssembly/target-features.ll
  llvm/test/MC/WebAssembly/array-fill.ll
  llvm/test/MC/WebAssembly/assembler-binary.ll
  llvm/test/MC/WebAssembly/bss.ll
  llvm/test/MC/WebAssembly/comdat.ll
  llvm/test/MC/WebAssembly/debug-info.ll
  llvm/test/MC/WebAssembly/explicit-sections.ll
  llvm/test/MC/WebAssembly/global-ctor-dtor.ll
  llvm/test/MC/WebAssembly/visibility.ll
  llvm/test/MC/WebAssembly/weak-alias.ll
  llvm/test/MC/WebAssembly/weak.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59625.191620.patch
Type: text/x-patch
Size: 14677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/e9bb978d/attachment-0001.bin>


More information about the llvm-commits mailing list