[LLVMdev] llvm.gcroot suggestion

nicolas geoffray nicolas.geoffray at gmail.com
Fri Feb 18 01:05:03 PST 2011


Hi Talin,

On Fri, Feb 18, 2011 at 1:36 AM, Talin <viridia at gmail.com> wrote:
>
> Thinking about it even more, here's a short summary of what I would
> propose:
>
>    - *llvm.gc.value*(value, metadata) - marks an SSA value as a garbage
>    collection root. This remains in effect for the lifetime of the SSA value.
>    - *llvm.gc.declare*(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.
>    - *llvm.gc.undeclare*(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.
>
>
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.

Cheers,
Nicolas



>
>
> 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.
>
> --
> -- Talin
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110218/52df92c8/attachment.html>


More information about the llvm-dev mailing list