diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-08 18:19:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-08 18:19:37 +0000 |
commit | fd755f7c7ca7df21befc94698502ad07b4cf8280 (patch) | |
tree | a12b01f28de3ea1900a2a8f05a035503a521b5c0 /include/llvm | |
parent | 127cab2cc7e9b6f474d4768b173af630d8b81840 (diff) | |
download | external_llvm-fd755f7c7ca7df21befc94698502ad07b4cf8280.zip external_llvm-fd755f7c7ca7df21befc94698502ad07b4cf8280.tar.gz external_llvm-fd755f7c7ca7df21befc94698502ad07b4cf8280.tar.bz2 |
Add support for representing edge counts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Analysis/ProfileInfoLoader.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/llvm/Analysis/ProfileInfoLoader.h b/include/llvm/Analysis/ProfileInfoLoader.h index b669401..33b87d8 100644 --- a/include/llvm/Analysis/ProfileInfoLoader.h +++ b/include/llvm/Analysis/ProfileInfoLoader.h @@ -31,6 +31,7 @@ class ProfileInfoLoader { std::vector<std::string> CommandLines; std::vector<unsigned> FunctionCounts; std::vector<unsigned> BlockCounts; + std::vector<unsigned> EdgeCounts; public: // ProfileInfoLoader ctor - Read the specified profiling data file, exiting // the program if the file is invalid or broken. @@ -50,7 +51,14 @@ public: // frequency information from whatever we have. // bool hasAccurateBlockCounts() const { - return !BlockCounts.empty(); + return !BlockCounts.empty() || !EdgeCounts.empty(); + } + + // hasAccurateEdgeCounts - Return true if we can synthesize accurate edge + // frequency information from whatever we have. + // + bool hasAccurateEdgeCounts() const { + return !EdgeCounts.empty(); } // getBlockCounts - This method is used by consumers of block counting @@ -58,6 +66,16 @@ public: // compute it from other, more refined, types of profile information. // void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts); + + // getEdgeCounts - This method is used by consumers of edge counting + // information. If we do not directly have edge count information, we compute + // it from other, more refined, types of profile information. + // + // Edges are represented as a pair, where the first element is the basic block + // and the second element is the successor number. + // + typedef std::pair<BasicBlock*, unsigned> Edge; + void getEdgeCounts(std::vector<std::pair<Edge, unsigned> > &Counts); }; } // End llvm namespace |