[LLVMdev] Improving Garbage Collection

Talin viridia at gmail.com
Wed Jul 6 19:21:10 PDT 2011

On Wed, Jul 6, 2011 at 3:51 PM, Kenneth Uildriks <kennethuil at gmail.com>wrote:

> On Wed, Jul 6, 2011 at 5:24 PM, Talin <viridia at gmail.com> wrote:
> > One approach would be to extend the current scheme to work with SSA
> values,
> > possibly using a new intrinsic. This is somewhat problematic because you
> > can't really have a 'do-nothing' function on SSA values - the result of
> the
> > function is always going to be a copy of the value, not the original
> value
> > that was passed in.
> That doesn't seem like a huge problem.  In the common case, the
> "marked" SSA value and the "unmarked" original wouldn't be live
> simultaneously.  Uses of the unmarked version reachable from the mark
> intrinsic can either be treated as a separate value or just left
> undefined.
> It makes sense to also add an "unmark" intrinsic to define when the
> SSA stack root goes out of scope

That's an interesting suggestion.

I realized, however, that there's another advantage to using type-based
marking rather than an intrinsic - it allows you to declare function
parameters as stack roots. Depending on the calling convention, some of the
parameters to a function will be located on the stack while others will be
passed in registers. The ones already in memory ought to be able to be
traced right where they are, but unfortunately there's no way to mark them
as roots with the intrinsic method - which means that the frontend has to
copy the parameters into an alloca and then mark that as a root.

-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110706/e68b0a7c/attachment.html>

More information about the llvm-dev mailing list