[PATCH] D119630: [WebAssembly] Use GeneralDynamic TLS for exception handling builtins.
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 12 06:39:38 PST 2022
sbc100 created this revision.
Herald added subscribers: wingo, ecnelises, sunfish, hiraditya, jgravelle-google, dschuff.
sbc100 requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.
These global TLS symbols are shared across all shared libraries and
connot be assumed to be local to the currently module.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119630
Files:
llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
llvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
Index: llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
===================================================================
--- llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
+++ llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
@@ -10,8 +10,8 @@
@global_var = global i32 0, align 4
; NO-TLS-DAG: __THREW__ = external global [[PTR]]
; NO-TLS-DAG: __threwValue = external global [[PTR]]
-; TLS-DAG: __THREW__ = external thread_local(localexec) global i32
-; TLS-DAG: __threwValue = external thread_local(localexec) global i32
+; TLS-DAG: __THREW__ = external thread_local global i32
+; TLS-DAG: __threwValue = external thread_local global i32
@global_longjmp_ptr = global void (%struct.__jmp_buf_tag*, i32)* @longjmp, align 4
; CHECK-DAG: @global_longjmp_ptr = global void (%struct.__jmp_buf_tag*, i32)* bitcast (void ([[PTR]], i32)* @emscripten_longjmp to void (%struct.__jmp_buf_tag*, i32)*)
Index: llvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
===================================================================
--- llvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
+++ llvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
@@ -9,8 +9,8 @@
@_ZTIc = external constant i8*
; NO-TLS-DAG: __THREW__ = external global [[PTR]]
; NO-TLS-DAG: __threwValue = external global i32
-; TLS-DAG: __THREW__ = external thread_local(localexec) global [[PTR]]
-; TLS-DAG: __threwValue = external thread_local(localexec) global i32
+; TLS-DAG: __THREW__ = external thread_local global [[PTR]]
+; TLS-DAG: __threwValue = external thread_local global i32
; Test invoke instruction with clauses (try-catch block)
define void @clause() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
Index: llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
@@ -422,7 +422,7 @@
// shared-memory module, which we don't want to be responsible for.
auto *Subtarget = TM.getSubtargetImpl();
auto TLS = Subtarget->hasAtomics() && Subtarget->hasBulkMemory()
- ? GlobalValue::LocalExecTLSModel
+ ? GlobalValue::GeneralDynamicTLSModel
: GlobalValue::NotThreadLocal;
GV->setThreadLocalMode(TLS);
return GV;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119630.408180.patch
Type: text/x-patch
Size: 2384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220212/d18d2565/attachment.bin>
More information about the llvm-commits
mailing list