summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
diff options
context:
space:
mode:
authorAndreas Neustifter <astifter-llvm@gmx.at>2009-09-04 12:34:44 +0000
committerAndreas Neustifter <astifter-llvm@gmx.at>2009-09-04 12:34:44 +0000
commited1ac4ae8eadb907ec6a41bb74cae1777a4e28d2 (patch)
tree9ceb7513e74ec9a45f565cac05396d485da9380b /lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
parent859fff476dfe8d83abdf4621b1d20062c0daa85c (diff)
downloadllvm-ed1ac4ae8eadb907ec6a41bb74cae1777a4e28d2.tar.gz
llvm-ed1ac4ae8eadb907ec6a41bb74cae1777a4e28d2.tar.bz2
llvm-ed1ac4ae8eadb907ec6a41bb74cae1777a4e28d2.tar.xz
Converted MaximumSpanningTree algorithm to a generic template, this could go
into llvm/ADT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp')
-rw-r--r--lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp b/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
index 2c06423872..cdaf5f1b0d 100644
--- a/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
+++ b/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
@@ -17,6 +17,7 @@
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/Passes.h"
+#include "llvm/Analysis/ProfileInfo.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Debug.h"
@@ -131,7 +132,8 @@ bool OptimalEdgeProfiler::runOnModule(Module &M) {
ProfileInfo::EdgeWeights ECs =
getAnalysisID<ProfileInfo>(ProfileEstimatorPassID, *F).getEdgeWeights(F);
std::vector<ProfileInfo::EdgeWeight> EdgeVector(ECs.begin(), ECs.end());
- MaximumSpanningTree MST = MaximumSpanningTree(EdgeVector);
+ MaximumSpanningTree<BasicBlock> MST (EdgeVector);
+ std::stable_sort(MST.begin(),MST.end());
// Check if (0,entry) not in the MST. If not, instrument edge
// (IncrementCounterInBlock()) and set the counter initially to zero, if