LLVM  4.0.0
Classes | Namespaces | Macros | Functions
BlockFrequencyInfoImpl.cpp File Reference
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
#include <numeric>
Include dependency graph for BlockFrequencyInfoImpl.cpp:

Go to the source code of this file.

Classes

struct  llvm::GraphTraits< IrreducibleGraph >
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define DEBUG_TYPE   "block-freq"
 

Functions

static char getHexDigit (int N)
 
static void combineWeight (Weight &W, const Weight &OtherW)
 
static void combineWeightsBySorting (WeightList &Weights)
 
static void combineWeightsByHashing (WeightList &Weights)
 
static void combineWeights (WeightList &Weights)
 
static uint64_t shiftRightAndRound (uint64_t N, int Shift)
 
static void cleanup (BlockFrequencyInfoImplBase &BFI)
 Clear all memory not needed downstream. More...
 
static void debugAssign (const BlockFrequencyInfoImplBase &BFI, const DitheringDistributer &D, const BlockNode &T, const BlockMass &M, const char *Desc)
 
static void convertFloatingToInteger (BlockFrequencyInfoImplBase &BFI, const Scaled64 &Min, const Scaled64 &Max)
 
static void unwrapLoop (BlockFrequencyInfoImplBase &BFI, LoopData &Loop)
 Unwrap a loop package. More...
 
static void findIrreducibleHeaders (const BlockFrequencyInfoImplBase &BFI, const IrreducibleGraph &G, const std::vector< const IrreducibleGraph::IrrNode * > &SCC, LoopData::NodeList &Headers, LoopData::NodeList &Others)
 Find extra irreducible headers. More...
 
static void createIrreducibleLoop (BlockFrequencyInfoImplBase &BFI, const IrreducibleGraph &G, LoopData *OuterLoop, std::list< LoopData >::iterator Insert, const std::vector< const IrreducibleGraph::IrrNode * > &SCC)
 

Macro Definition Documentation

#define DEBUG_TYPE   "block-freq"

Definition at line 23 of file BlockFrequencyInfoImpl.cpp.

Function Documentation

static void cleanup ( BlockFrequencyInfoImplBase BFI)
static

Clear all memory not needed downstream.

Releases all memory not used downstream. In particular, saves Freqs.

Definition at line 260 of file BlockFrequencyInfoImpl.cpp.

References llvm::BlockFrequencyInfoImplBase::clear(), and llvm::BlockFrequencyInfoImplBase::Freqs.

Referenced by llvm::BlockFrequencyInfoImplBase::finalizeMetrics(), llvm::CrashRecoveryContext::registerCleanup(), and llvm::CrashRecoveryContext::unregisterCleanup().

static void combineWeight ( Weight &  W,
const Weight &  OtherW 
)
static

Definition at line 120 of file BlockFrequencyInfoImpl.cpp.

References assert().

Referenced by combineWeightsByHashing(), and combineWeightsBySorting().

static void combineWeights ( WeightList &  Weights)
static
static void combineWeightsByHashing ( WeightList &  Weights)
static

Definition at line 157 of file BlockFrequencyInfoImpl.cpp.

References combineWeight(), I, and llvm::NextPowerOf2().

Referenced by combineWeights().

static void combineWeightsBySorting ( WeightList &  Weights)
static

Definition at line 136 of file BlockFrequencyInfoImpl.cpp.

References combineWeight(), E, I, and L.

Referenced by combineWeights().

static void convertFloatingToInteger ( BlockFrequencyInfoImplBase BFI,
const Scaled64 &  Min,
const Scaled64 &  Max 
)
static
static void createIrreducibleLoop ( BlockFrequencyInfoImplBase BFI,
const IrreducibleGraph G,
LoopData *  OuterLoop,
std::list< LoopData >::iterator  Insert,
const std::vector< const IrreducibleGraph::IrrNode * > &  SCC 
)
static
static void debugAssign ( const BlockFrequencyInfoImplBase BFI,
const DitheringDistributer &  D,
const BlockNode &  T,
const BlockMass M,
const char *  Desc 
)
static
static void findIrreducibleHeaders ( const BlockFrequencyInfoImplBase BFI,
const IrreducibleGraph G,
const std::vector< const IrreducibleGraph::IrrNode * > &  SCC,
LoopData::NodeList &  Headers,
LoopData::NodeList &  Others 
)
static
static char getHexDigit ( int  N)
static

Definition at line 33 of file BlockFrequencyInfoImpl.cpp.

References assert(), and N.

Referenced by llvm::bfi_detail::BlockMass::print().

static uint64_t shiftRightAndRound ( uint64_t  N,
int  Shift 
)
static

Definition at line 185 of file BlockFrequencyInfoImpl.cpp.

References assert(), and N.

Referenced by llvm::BlockFrequencyInfoImplBase::Distribution::normalize().

static void unwrapLoop ( BlockFrequencyInfoImplBase BFI,
LoopData &  Loop 
)
static

Unwrap a loop package.

Visits all the members of a loop, adjusting their BlockData according to the loop's pseudo-node.

Definition at line 474 of file BlockFrequencyInfoImpl.cpp.

References llvm::dbgs(), DEBUG, F, llvm::BlockFrequencyInfoImplBase::Freqs, llvm::BlockFrequencyInfoImplBase::getBlockName(), llvm::BlockFrequencyInfoImplBase::getLoopName(), N, and llvm::BlockFrequencyInfoImplBase::Working.

Referenced by llvm::BlockFrequencyInfoImplBase::unwrapLoops().