[llvm] r187213 - Add preliminary support for hashing DIEs and breaking them into

Daniel Berlin dberlin at dberlin.org
Mon Jul 29 15:26:35 PDT 2013


> > *nod* I found this easier to reason about than the iterative merely
> > because I have to find the top of the stack and then go back down, but
> > it's not a trial either way.
>
> Right - I haven't seen the iterative version, so perhaps I'll
> understand what you mean if/when I see it. You're right though, I can
> at least picture that - build a stack of parents, then walk back down.
> (weird - I wonder what artifact of GCC's implementation lead them to
> hashing down rather than up - I guess they split out the type DIE &
> its parents first and then simply walked the whole tree?)

Yes.
1. It chooses the types to comdat at the highest level possible. It
starts at the root of a comp unit, and tries to comdat types at the
highest level possible.  At the time, this was because the overhead of
comdatting types at the lowest level was so great due to size of
reference encoding, etc (IE in a large program, referring to the
comdat'd section for a small type may completely dwarf the overhead of
that die appearing in each comp unit).
2. The hashes are generated after the decision to comdat a type tree
is made, so at that point the direction you walk doesn't matter. It
has convenient macros for walking die children, and had a marking
mechanism to avoid DIE loops, so ...



More information about the llvm-commits mailing list