[llvm] r197284 - [block-freq] Begin move of BlockFrequency::EntryFreq -> BlockFrequencyImpl::EntryFreq.

Michael Gottesman mgottesman at apple.com
Fri Dec 13 15:44:36 PST 2013


Author: mgottesman
Date: Fri Dec 13 17:44:36 2013
New Revision: 197284

URL: http://llvm.org/viewvc/llvm-project?rev=197284&view=rev
Log:
[block-freq] Begin move of BlockFrequency::EntryFreq -> BlockFrequencyImpl::EntryFreq.

This is a property associated with a function, not with BlockFrequency data.
Additionally it loosens the artifical requirement that the entry frequency
arbitrarily be the same for every function.

There is a series of patches forthcoming updating various code that uses the old
way of getting a block frequency to the new location.

Modified:
    llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h

Modified: llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h?rev=197284&r1=197283&r2=197284&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h (original)
+++ llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h Fri Dec 13 17:44:36 2013
@@ -48,7 +48,7 @@ class BlockFrequencyImpl {
 
   typedef GraphTraits< Inverse<BlockT *> > GT;
 
-  const uint32_t EntryFreq;
+  static const uint64_t EntryFreq = 1 << 14;
 
   std::string getBlockName(BasicBlock *BB) const {
     return BB->getName().str();
@@ -263,7 +263,7 @@ class BlockFrequencyImpl {
   friend class BlockFrequencyInfo;
   friend class MachineBlockFrequencyInfo;
 
-  BlockFrequencyImpl() : EntryFreq(BlockFrequency::getEntryFrequency()) { }
+  BlockFrequencyImpl() { }
 
   void doFunction(FunctionT *fn, BlockProbInfoT *bpi) {
     Fn = fn;
@@ -312,6 +312,9 @@ class BlockFrequencyImpl {
   }
 
 public:
+
+  uint64_t getEntryFrequency() { return EntryFreq; }
+
   /// getBlockFreq - Return block frequency. Return 0 if we don't have it.
   BlockFrequency getBlockFreq(const BlockT *BB) const {
     typename DenseMap<const BlockT *, BlockFrequency>::const_iterator





More information about the llvm-commits mailing list