[LLVMdev] Improving Garbage Collection

Talin viridia at gmail.com
Mon Jul 11 14:28:38 PDT 2011


So - here's a really modest proposal:

Based on Renato's suggestion, there is a way to associate arbitrary
annotation data with any LLVM type.

So what I would propose as a first step is to simply replace (or perhaps
supplement) the current llvm.gcroot() feature with a type annotation. That
is, LLVM would only support roots that are allocas, just it does today. The
backend code would not change at all, except that in addition to detecting
the presence of the llvm.gcroot marker, it would also detect the presence of
a type annotation. That means that *every* alloca of a given type would be
considered a root - there would be no need to insert the llvm.gcroot
intrinsic into each function.

Later we could think about supporting SSA local variables, parameters, and
register maps. But this first step is a prerequisite for all of those other
things, and I'm thinking that it's a relatively easy step compared to the
others.

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


More information about the llvm-dev mailing list