[PATCH] D64949: [WebAssembly] Fix __builtin_wasm_tls_base intrinsic
Guanzhong Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 18 14:17:43 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366499: [WebAssembly] Fix __builtin_wasm_tls_base intrinsic (authored by quantum, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D64949?vs=210675&id=210676#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64949/new/
https://reviews.llvm.org/D64949
Files:
cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
llvm/trunk/test/CodeGen/WebAssembly/tls-general-dynamic.ll
Index: llvm/trunk/test/CodeGen/WebAssembly/tls-general-dynamic.ll
===================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/tls-general-dynamic.ll
+++ llvm/trunk/test/CodeGen/WebAssembly/tls-general-dynamic.ll
@@ -84,6 +84,17 @@
ret i8* %1
}
+; CHECK-LABEL: tls_base_write:
+; CHECK-NEXT: .functype tls_base_write (i32) -> ()
+define void @tls_base_write(i8** %output) {
+; CHECK-NEXT: global.get __tls_base
+; CHECK-NEXT: i32.store 0
+; CHECK-NEXT: return
+ %1 = call i8* @llvm.wasm.tls.base()
+ store i8* %1, i8** %output
+ ret void
+}
+
; CHECK: .type tls, at object
; TLS-NEXT: .section .tbss.tls,"",@
; NO-TLS-NEXT: .section .bss.tls,"",@
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
@@ -235,7 +235,7 @@
assert(PtrVT == MVT::i32 && "only wasm32 is supported for now");
MachineSDNode *TLSBase = CurDAG->getMachineNode(
- WebAssembly::GLOBAL_GET_I32, DL, MVT::i32,
+ WebAssembly::GLOBAL_GET_I32, DL, MVT::i32, MVT::Other,
CurDAG->getTargetExternalSymbol("__tls_base", PtrVT),
Node->getOperand(0));
ReplaceNode(Node, TLSBase);
Index: cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
===================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
+++ cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
@@ -31,7 +31,7 @@
// Thread-local storage
TARGET_BUILTIN(__builtin_wasm_tls_size, "z", "nc", "bulk-memory")
-TARGET_BUILTIN(__builtin_wasm_tls_base, "v*", "n", "bulk-memory")
+TARGET_BUILTIN(__builtin_wasm_tls_base, "v*", "nU", "bulk-memory")
// Floating point min/max
BUILTIN(__builtin_wasm_min_f32, "fff", "nc")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64949.210676.patch
Type: text/x-patch
Size: 1942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190718/d0c479cd/attachment.bin>
More information about the cfe-commits
mailing list