<div dir="ltr">Hi Carlo,<div><br></div><div>There's no scalable way to do this that I know of. Disabling mem2reg might do the trick, but I don't know how to do that without changing LLVM source. Another workaround might be to mark the relevant locals `volatile` in your source, but doing that for your entire code base is probably not practical. On the WebAssembly level, we have discussed adding the ability to do stack scanning in the past, but if we add that, it won't be any time soon.</div><div><br></div><div>Best,</div><div><br></div><div>Thomas</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 15, 2021 at 1:41 AM Carlo Kok via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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. <br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks,<br>
<br>
Carlo Kok<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>