[llvm-commits] [llvm] r80358 - in /llvm/trunk/lib/Transforms/Instrumentation: MaximumSpanningTree.cpp MaximumSpanningTree.h

Andreas Neustifter e0325716 at student.tuwien.ac.at
Sun Aug 30 01:52:26 PDT 2009


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

Hi,

Chris Lattner wrote:
> On Aug 28, 2009, at 4:28 AM, Andreas Neustifter wrote:
> 
>> Author: astifter
>> Date: Fri Aug 28 06:28:24 2009
>> New Revision: 80358
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=80358&view=rev
>> Log:
>> Preparation for Optimal Edge Profiling:
>> This implements the maximum spanning tree algorithm on CFGs  
>> according to
>> weights given by the ProfileEstimator. This is then used to  
>> implement Optimal
>> Edge Profiling.
> 
> Hi Andreas,
> 
>> +  // compare two weighted edges
>> +  struct VISIBILITY_HIDDEN EdgeWeightCompare {
>> +    bool operator()(const ProfileInfo::EdgeWeight X,
>> +                    const ProfileInfo::EdgeWeight Y) const {
>> +      if (X.second > Y.second) return true;
>> +      if (X.second < Y.second) return false;
>> +#ifndef NDEBUG
> 
> Why does this predicate depend on whether assertions are enabled or  
> not?  That sounds like a potential source of really insidious bugs.

The plan is to have the debug output as stable as possible to be able to
compare it to output from previous runs. The weight of the edge
(X.second, Y.second) is the only part thats really necessary, the part
in the predicated tries to ensure stable sorting of edges of the same
weight.

But if your experience tells you that this may lead to complications I
will remove it.

Andi

- --
==========================================================================
This email is signed, for more information see
http://web.student.tuwien.ac.at/~e0325716/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqaPcYACgkQPiYq0rq7s/DqYACdHOe3mmML1qvyRCSIGeHqQ0cm
nCsAniA/63TwREOceF3rYvb0aHFYRf2G
=ZPWm
-----END PGP SIGNATURE-----



More information about the llvm-commits mailing list