1 //===- llvm/Analysis/MaximumSpanningTree.h - Interface ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This module privides means for calculating a maximum spanning tree for the
11 // CFG of a function according to a given profile.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_ANALYSIS_MAXIMUMSPANNINGTREE_H
16 #define LLVM_ANALYSIS_MAXIMUMSPANNINGTREE_H
18 #include "llvm/Analysis/ProfileInfo.h"
19 #include "llvm/Support/raw_ostream.h"
25 class MaximumSpanningTree {
27 typedef std::vector<ProfileInfo::Edge> MaxSpanTree;
33 static char ID; // Class identification, replacement for typeinfo
35 // MaxSpanTree() - Calculates a MST for a function according to a profile.
36 // If inverted is true, all the edges *not* in the MST are returned. As a
37 // special also all leaf edges of the MST are not included, this makes it
38 // easier for the OptimalEdgeProfileInstrumentation to use this MST to do
39 // an optimal profiling.
40 MaximumSpanningTree(Function *F, ProfileInfo *PI, bool invert);
42 virtual MaxSpanTree::iterator begin();
43 virtual MaxSpanTree::iterator end();
48 } // End llvm namespace