On Tue, Dec 11, 2012 at 5:11 PM, Diego Novillo wrote:
> On Mon, Dec 10, 2012 at 1:25 PM, Steven Bosscher wrote:
>> This all made me wonder why we can't use the known hierarchy of the
>> intermediate representations. Ideally, there should be only two
>> classes of objects: global state variables (not ideal, but a reality)
>> and objects reachable from the symbol table. AFAICT anything that
>> isn't in one of those two categories has probably become garbage
>> somewhere along the way.
>
> By "hierarchy" you don't mean actual type hierarchy, right?  You seem
> to be looking for a way of having the GC objects in a non-cyclic graph
> so that we only walk each reachable object exactly once?

Right, not hierarchy in the C++/inheritance/etc sense, but in "what
piece of IR depends on what".


>> It seems to be that this hierarchy could also be useful if/when GCC
>> will move away from generated walkers (i.e. gengtype). If we can
>> somehow enforce a hierarchy, the markers become much simpler. Also,
>> the hierarchy could be used to verify "no leaks" from alloc pools, and
>> probably for other things I can't think of right now.
>
> Yes, this may be doable with the manual marking strategy, but it
> requires some knowledge of the kind "my data structure has a pointer
> to a basic block, and basic blocks are higher in the GC graph, so I
> don't need to walk them".

That knowledge should be fairly obvious for some of the basic data
structures. At least for the CFG it is easy, I'd expect it to be easy
for the call graph cq, symbol table also, and GIMPLE tuples as well.

Ciao!
Steven

Reply via email to