LLVM  6.0.0svn
Classes | Namespaces | Macros | Functions
BlockFrequencyInfoImpl.cpp File Reference
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/BlockFrequency.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ScaledNumber.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <list>
#include <numeric>
#include <utility>
#include <vector>
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

◆ DEBUG_TYPE

#define DEBUG_TYPE   "block-freq"

Definition at line 41 of file BlockFrequencyInfoImpl.cpp.

Function Documentation

◆ cleanup()

static void cleanup ( BlockFrequencyInfoImplBase BFI)
static

◆ combineWeight()

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

Definition at line 140 of file BlockFrequencyInfoImpl.cpp.

References assert().

Referenced by combineWeightsByHashing(), and combineWeightsBySorting().

◆ combineWeights()

static void combineWeights ( WeightList &  Weights)
static

◆ combineWeightsByHashing()

static void combineWeightsByHashing ( WeightList &  Weights)
static

Definition at line 177 of file BlockFrequencyInfoImpl.cpp.

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

Referenced by combineWeights().

◆ combineWeightsBySorting()

static void combineWeightsBySorting ( WeightList &  Weights)
static

Definition at line 156 of file BlockFrequencyInfoImpl.cpp.

References combineWeight(), E, I, llvm::RISCVFenceField::O, and llvm::parallel::sort().

Referenced by combineWeights().

◆ convertFloatingToInteger()

static void convertFloatingToInteger ( BlockFrequencyInfoImplBase BFI,
const Scaled64 &  Min,
const Scaled64 &  Max 
)
static

◆ createIrreducibleLoop()

static void createIrreducibleLoop ( BlockFrequencyInfoImplBase BFI,
const IrreducibleGraph G,
LoopData *  OuterLoop,
std::list< LoopData >::iterator  Insert,
const std::vector< const IrreducibleGraph::IrrNode *> &  SCC 
)
static

◆ debugAssign()

static void debugAssign ( const BlockFrequencyInfoImplBase BFI,
const DitheringDistributer &  D,
const BlockNode &  T,
const BlockMass M,
const char Desc 
)
static

◆ findIrreducibleHeaders()

static void findIrreducibleHeaders ( const BlockFrequencyInfoImplBase BFI,
const IrreducibleGraph G,
const std::vector< const IrreducibleGraph::IrrNode *> &  SCC,
LoopData::NodeList &  Headers,
LoopData::NodeList &  Others 
)
static

◆ getHexDigit()

static char getHexDigit ( int  N)
static

Definition at line 53 of file BlockFrequencyInfoImpl.cpp.

References assert(), and N.

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

◆ shiftRightAndRound()

static uint64_t shiftRightAndRound ( uint64_t  N,
int  Shift 
)
static

Definition at line 206 of file BlockFrequencyInfoImpl.cpp.

References assert(), and N.

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

◆ unwrapLoop()

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 498 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().