This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question on updating DF info during code hoisting

On Tue, Oct 23, 2012 at 5:17 AM, Bin.Cheng wrote:
> Thanks for your explanation.
> Now I understand how df_insn_info is updated when
> deleting/modifying/creating insn. One more question is when and how
> IN/OUT information is updated. GCC calls df_set_bb_dirty when handling
> insns, but I did not found any spot in GCSE updating that information.
> is it done in CFG_CLEANUP?

It is done lazily in any call to df_analyze.

> I would like to study DF infrastructure later, could you share some
> background knowledge on this, for example theory/algorithms to which
> GCC referred. Though there is good comment at the beginning of
> df-core.c, it doesn't mention any background/references.

The stuff in df-problems.c is mostly just Dragon book stuff. For the
solver itself there is a reference to a paper from Harvey IIRC, but
this is also mostly just Dragon book or Muchnick stuff. The only
"fancy" stuff would be how several classic problems are combined. For
example, DF_LIVE is actually a combination of "classic" liveness and
partial availability. Likewise for the pruned version of reaching
definitions. The MD problem is probably not described anywhere, but
it's basically poor-man's SSA.

The scan problem and data structures are compiler specific. I don't
think there are any documented theories about this, it's too specific
because all of it is strongly bound to how the compiler's internal
representation is constructed. The DF infrastructure supports (or
works around, depending on your POV) the RTL representation with
on-the-side operand caches. Other compilers or internal
representations may not need that (e.g. GIMPLE operand caches are on
the GIMPLE statement themselves). The documentation in the code is
quite good, but if you have any specific questions then there's always
this mailing list :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]