llvm-project/llvm/lib/Target/WebAssembly/MCTargetDesc
Thomas Lively 3f34e1b883 [WebAssembly] Merge used feature sets, update atomics linkage policy
Summary:
It does not currently make sense to use WebAssembly features in some functions
but not others, so this CL adds an IR pass that takes the union of all used
feature sets and applies it to each function in the module. This allows us to
prevent atomics from being lowered away if some function has opted in to using
them. When atomics is not enabled anywhere, we detect whether there exists any
atomic operations or thread local storage that would be stripped and 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.

Reviewers: aheejin, sbc100, dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59625

llvm-svn: 357226
2019-03-29 00:14:01 +00:00
..
CMakeLists.txt [WebAssembly] Remove ELF file support. 2018-07-16 23:09:29 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WebAssemblyAsmBackend.cpp [WebAssembly] Rename wasm fixup kinds 2019-03-28 02:07:28 +00:00
WebAssemblyFixupKinds.h [WebAssembly] Rename wasm fixup kinds 2019-03-28 02:07:28 +00:00
WebAssemblyMCAsmInfo.cpp [WebAssembly] clang-tidy (NFC) 2019-02-04 19:13:39 +00:00
WebAssemblyMCAsmInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WebAssemblyMCCodeEmitter.cpp [WebAssembly] Rename wasm fixup kinds 2019-03-28 02:07:28 +00:00
WebAssemblyMCTargetDesc.cpp [WebAssembly] clang-tidy (NFC) 2019-02-04 19:13:39 +00:00
WebAssemblyMCTargetDesc.h [WebAssembly] Merge used feature sets, update atomics linkage policy 2019-03-29 00:14:01 +00:00
WebAssemblyTargetStreamer.cpp [WebAssembly] Add codegen support for the import_field attribute 2019-02-01 22:27:34 +00:00
WebAssemblyTargetStreamer.h [WebAssembly] Add codegen support for the import_field attribute 2019-02-01 22:27:34 +00:00
WebAssemblyWasmObjectWriter.cpp [WebAssembly] Rename wasm fixup kinds 2019-03-28 02:07:28 +00:00