[llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Add calculation of maximum spanning tree.

Daniel Dunbar daniel at zuster.org
Mon Aug 24 09:00:56 PDT 2009

Hi Andreas,

On Wed, Aug 19, 2009 at 9:09 AM, Andreas
Neustifter<e0325716 at student.tuwien.ac.at> wrote:
> Hi,
> this is a preparation patch for Optimal Edge Profiling, it adds a module to
> calculate the maximum spanning tree of an function according to an given
> ProfileInformation.

This class is specialized to ProfileInfo, so I don't think it should
go into the generic headers. Can it just live where the optimal edge
profiling implementation does, as private helper class?

Also, MSTForest is just union find, right? Can it use
llvm/ADT/EquivalenceClasses.h instead?

Similarly, MaximumSpanningTree should say 'Kruskal's algorithm'
somewhere. Also, would it make more sense to just implement MST, and
have clients use set_difference if they want the complement, instead
of the inverted flag? I would find this easier to read (I think).

It isn't necessary, but I think this code might be simpler and easier
to read if it was just a generic implementation of Kruskal's
algorithm, which the Optimal Edge Profiling could manage its own
instantiation of. Then it would make sense to drop it in ADT/

 - Daniel

More information about the llvm-commits mailing list