Because we shift the stack pointer by an unknown amount, we need an
additional pointer. In the case where we have variable-size objects
as well, we can't reuse the frame pointer, thus three pointers.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp | ||
---|---|---|
40 ↗ | (On Diff #76791) | Maybe clarify that "overaligned" means more aligned than the stack pointer (rather than more than natural alignment for the slot itself). |
test/CodeGen/WebAssembly/alignment.ll | ||
1 ↗ | (On Diff #76791) | alignment.ll seems a bit generic. It could probably be stack-aligment or else these tests could just be added to userstack.ll |
29 ↗ | (On Diff #76791) | Might as well check for the value of the const too, so we know the alignment is 16. |
34 ↗ | (On Diff #76791) | Seems like we should be storing directly from BP. Where does this copy_local come from? |
test/CodeGen/WebAssembly/alignment.ll | ||
---|---|---|
34 ↗ | (On Diff #76791) | Huh. This is caused by us emitting a frame pointer, and register stackification doing magic to it. Prolog/epilogue:
Reg stackify:
The good news is this just gets translated to get_local in s2wasm. And adding -wasm-explicit-locals models it that was as well, so there's no actual cost here, it's just kinda quirky. |