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

Andreas Neustifter e0325716 at student.tuwien.ac.at
Fri Aug 28 04:09:08 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Andreas Neustifter wrote:
> Hi Daniel!
> 
> Daniel Dunbar wrote:
>
>> On Wed, Aug 19, 2009 at 9:09 AM, Andreas
>> Neustifter<e0325716 at student.tuwien.ac.at> wrote:
>>>
>>> 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?
> 
> Yes, of course. As long as I'm not able to make this an generic class,
> but see below...
> 
>> Also, MSTForest is just union find, right? Can it use
>> llvm/ADT/EquivalenceClasses.h instead?
> 
> Yep, guess I can. Have to try it first, tough.

I moved the class to lib/Trans../Instr.. and implemented EquivalenceClasses.

>> 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).
> 
> Will try that too.
>
>> 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/
> 
> I am not sure if I manage to work this out but I will try.

I did not succeed immediately, so I will check it in and make these
changes later.

Andi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqXutQACgkQPiYq0rq7s/CTyQCdHKgMg2JdjeA/kAv0KXsThUns
+KMAn1LgjnlKDM+CZwePDiVi1bWqo7e1
=ILS2
-----END PGP SIGNATURE-----



More information about the llvm-commits mailing list