[llvm-commits] [llvm] r90320 - /llvm/trunk/lib/Transforms/Instrumentation/MaximumSpanningTree.h
Andreas Neustifter
astifter-llvm at gmx.at
Wed Dec 2 07:57:15 PST 2009
Author: astifter
Date: Wed Dec 2 09:57:15 2009
New Revision: 90320
URL: http://llvm.org/viewvc/llvm-project?rev=90320&view=rev
Log:
Cheap, mostly strict, stable sorting.
This is necessary for tests so the results are comparable.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/MaximumSpanningTree.h
Modified: llvm/trunk/lib/Transforms/Instrumentation/MaximumSpanningTree.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MaximumSpanningTree.h?rev=90320&r1=90319&r2=90320&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MaximumSpanningTree.h (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MaximumSpanningTree.h Wed Dec 2 09:57:15 2009
@@ -15,6 +15,7 @@
#ifndef LLVM_ANALYSIS_MAXIMUMSPANNINGTREE_H
#define LLVM_ANALYSIS_MAXIMUMSPANNINGTREE_H
+#include "llvm/BasicBlock.h"
#include "llvm/ADT/EquivalenceClasses.h"
#include <vector>
#include <algorithm>
@@ -33,6 +34,18 @@
typename MaximumSpanningTree<CT>::EdgeWeight Y) const {
if (X.second > Y.second) return true;
if (X.second < Y.second) return false;
+ if (const BasicBlock *BBX = dyn_cast<BasicBlock>(X.first.first)) {
+ if (const BasicBlock *BBY = dyn_cast<BasicBlock>(Y.first.first)) {
+ if (BBX->size() > BBY->size()) return true;
+ if (BBX->size() < BBY->size()) return false;
+ }
+ }
+ if (const BasicBlock *BBX = dyn_cast<BasicBlock>(X.first.second)) {
+ if (const BasicBlock *BBY = dyn_cast<BasicBlock>(Y.first.second)) {
+ if (BBX->size() > BBY->size()) return true;
+ if (BBX->size() < BBY->size()) return false;
+ }
+ }
return false;
}
};
More information about the llvm-commits
mailing list