summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit18156bd75ca65c3740e4dc6be50efe1a69e9839c (patch)
tree7e0e5ed494a5d04d30ae8af4f6c8e74557160033 /llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
parent0c2477c26b530ad91c44814bf6fbea1c390ae7a6 (diff)
downloadbcm5719-llvm-18156bd75ca65c3740e4dc6be50efe1a69e9839c.tar.gz
bcm5719-llvm-18156bd75ca65c3740e4dc6be50efe1a69e9839c.zip
Converted MaximumSpanningTree algorithm to a generic template, this could go
into llvm/ADT. llvm-svn: 81001
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp b/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
index 2c064238723..cdaf5f1b0df 100644
--- a/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud