So - here's a really modest proposal:<div><br></div><div>Based on Renato's suggestion, there is a way to associate arbitrary annotation data with any LLVM type.</div><div><br></div><div>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.</div>

<div><br></div><div>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.</div>

<div><br></div><div>-- Talin</div>