<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Would a GC strategy with gc roots not do it? </div><div><br></div><div>On Wed, Dec 15, 2021, at 18:53, Thomas Lively wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div>Hi Carlo,<br></div><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.<br></div><div><br></div><div>Best,<br></div><div><br></div><div>Thomas<br></div></div><div><br></div><div class="qt-gmail_quote"><div dir="ltr" class="qt-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="qt-gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div>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></div><div> <br></div><div> 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></div><div> <br></div><div> 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></div><div> <br></div><div> 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></div><div> <br></div><div> Thanks,<br></div><div> <br></div><div> Carlo Kok<br></div><div> _______________________________________________<br></div><div> LLVM Developers mailing list<br></div><div> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br></div><div> <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></div></blockquote></div></blockquote></body></html>