summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp
diff options
context:
space:
mode:
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