[PATCH] D101608: [WebAssembly] Support for WebAssembly globals in LLVM IR
Andy Wingo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 6 03:24:46 PDT 2021
wingo added inline comments.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISD.def:48
+
+// Reference Types
+HANDLE_MEM_NODETYPE(GLOBAL_GET)
----------------
tlively wrote:
> sbc100 wrote:
> > Is this just for ref types or also for global that hold integers too (like `__stack_pointer`)
> Yep, it's for arbitrary types (see the tests), so this comment should be updated.
FWIW I think you would be able to define `__stack_pointer` from IR via
```
@__stack_pointer = external addrspace(1) global i32
```
and then to use it:
```
%current_sp = load i32, i32 addrspace(1)* @__stack_pointer
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101608/new/
https://reviews.llvm.org/D101608
More information about the llvm-commits
mailing list