Hi Talin,<br><br><div class="gmail_quote">On Fri, Feb 18, 2011 at 1:36 AM, Talin <span dir="ltr"><<a href="mailto:viridia@gmail.com">viridia@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thinking about it even more, here's a short summary of what I would propose:<div><ul><li><b>llvm.gc.value</b>(value, metadata) - marks an SSA value as a garbage collection root. This remains in effect for the lifetime of the SSA value.</li>


<li><b>llvm.gc.declare</b>(alloca, metadata) - marks an alloca as a garbage collection root. This intrinsic tells LLVM that it should start treating the alloca as a GC root from that point in the CFG onward.</li><li><b>llvm.gc.undeclare</b>(alloca) - tells LLVM that the alloca should no longer be considered a GC root. If llvm.undeclare() is never called, then the alloca is treated as a root until the end of the function.</li>
</ul></div></blockquote><div><br></div><div>I am unsure why you need to provide a live range for a gc root. It looks to me that LLVM should be able to compute it (considering GC allocas never escape). I think the reason why you want this intrinsic is to work around the current way a GC root is declared (an alloca in the first block), but it does not have to be that way. At some point, Chris suggested that we could put the GC root in a different address space than other pointers.</div>
<div><br></div><div>Cheers,</div><div>Nicolas</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><ul>

</ul><div>One other thing I thought of was that it would be convenient to declare function parameters with llvm.gc.value(). However, I can get around not having that as a feature.</div><div><br></div><div>-- </div>-- Talin<br>



</div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br>