aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2020-09-24 14:56:19 -0700
committerThomas Lively <tlively@google.com>2020-09-24 14:56:19 -0700
commit1c5a3c4d382353e582ecf4913e338599028e267f (patch)
tree8f4c44cb82df9a04db400a9f4ced1a263a70231e /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parenta079f619b5a1959af8af37cabdea27ae542903db (diff)
downloadllvm-1c5a3c4d382353e582ecf4913e338599028e267f.zip
llvm-1c5a3c4d382353e582ecf4913e338599028e267f.tar.gz
llvm-1c5a3c4d382353e582ecf4913e338599028e267f.tar.bz2
[WebAssembly] Make SjLj lowering globals thread-local
Emscripten's longjump and exception mechanism depends on two global variables, `__THREW__` and `__threwValue`, which are changed to be defined as thread-local in https://github.com/emscripten-core/emscripten/pull/12056. This patch updates the corresponding code in the WebAssembly backend to properly declare these globals as thread-local as well. Differential Revision: https://reviews.llvm.org/D88262
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 6e88530..60a7dee 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -348,12 +348,6 @@ FunctionPass *WebAssemblyPassConfig::createTargetRegisterAllocator(bool) {
//===----------------------------------------------------------------------===//
void WebAssemblyPassConfig::addIRPasses() {
- // Runs LowerAtomicPass if necessary
- addPass(new CoalesceFeaturesAndStripAtomics(&getWebAssemblyTargetMachine()));
-
- // This is a no-op if atomics are not used in the module
- addPass(createAtomicExpandPass());
-
// Add signatures to prototype-less function declarations
addPass(createWebAssemblyAddMissingPrototypes());
@@ -389,6 +383,12 @@ void WebAssemblyPassConfig::addIRPasses() {
// Expand indirectbr instructions to switches.
addPass(createIndirectBrExpandPass());
+ // Lower atomics and TLS if necessary
+ addPass(new CoalesceFeaturesAndStripAtomics(&getWebAssemblyTargetMachine()));
+
+ // This is a no-op if atomics are not used in the module
+ addPass(createAtomicExpandPass());
+
TargetPassConfig::addIRPasses();
}