[llvm-dev] WASM force stack slots for allocas

Carlo Kok via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 14 22:41:36 PST 2021


As far as I can tell llvm webassembly has two stacks; one is on the javascript wasm stack and cannot be walked; the other one is in memory before or after the datasegment and can be walked. 

I'm using the BoehmGC; which btw works really well except that it cannot scan the wasm stack in any way that I can find thus causing it to free things on the javascript/wasm stack.

Is there a good solution for this, or otherwise a way to force some allocas to stay alloca through the optimizer? Preferably without changing llvm itself of course.

I know about the wasm gc prpoosal, The wasm gc proposal is still in flux, moves slowly and I can respect that; I however I am looking for a solution that works in the shorter term.

Thanks,

Carlo Kok


More information about the llvm-dev mailing list