diff --git a/include/llvm/Analysis/ProfileInfoLoader.h b/include/llvm/Analysis/ProfileInfoLoader.h index b6694014227..33b87d89fb6 100644 --- a/include/llvm/Analysis/ProfileInfoLoader.h +++ b/include/llvm/Analysis/ProfileInfoLoader.h @@ -31,6 +31,7 @@ class ProfileInfoLoader { std::vector CommandLines; std::vector FunctionCounts; std::vector BlockCounts; + std::vector 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 > &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 Edge; + void getEdgeCounts(std::vector > &Counts); }; } // End llvm namespace