[PATCH] D12393: WebAssembly: generate global loads

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 09:51:09 PDT 2015


jfb added a comment.

In http://reviews.llvm.org/D12393#234247, @sunfishcode wrote:

> I would like to propose a different approach to global variables.
>
> We should start by allocating all global variables inside the address space, using a plain old data section. This will be easy to do, it's what LLVM normally does, it'll support all global variables, and it's something we'll need to do anyway. And, it'll be easier to do if we don't have to contend with special-case tglobaladdr patterns up front.
>
> Once that's done, we can talk about how best to optimize non-address-taken globals.


I'm not sure I understand what you propose: I want to map C++ non-address-taken variables to wasm globals, which aren't in linear memory and can't alias with linear memory. Trying to make sense of what you propose: we could move all address-not-taken variables to their own section, and then perform the lowering I propose?

We could also start by just ignoring wasm globals entirely (just have `load`/`store` and linear memory).


http://reviews.llvm.org/D12393





More information about the llvm-commits mailing list