LLVM API Documentation

Defines | Functions | Variables
BranchProbabilityInfo.cpp File Reference
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Support/Debug.h"
Include dependency graph for BranchProbabilityInfo.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "branch-prob"

Functions

 INITIALIZE_PASS_BEGIN (BranchProbabilityInfo,"branch-prob","Branch Probability Analysis", false, true) INITIALIZE_PASS_END(BranchProbabilityInfo
static uint32_t getMaxWeightFor (BasicBlock *BB)

Variables

branch prob
branch Branch Probability Analysis
branch Branch Probability false
static const uint32_t LBH_TAKEN_WEIGHT = 124
static const uint32_t LBH_NONTAKEN_WEIGHT = 4
static const uint32_t UR_TAKEN_WEIGHT = 1
 Unreachable-terminating branch taken weight.
static const uint32_t UR_NONTAKEN_WEIGHT = 1024*1024 - 1
 Unreachable-terminating branch not-taken weight.
static const uint32_t CC_TAKEN_WEIGHT = 4
 Weight for a branch taken going into a cold block.
static const uint32_t CC_NONTAKEN_WEIGHT = 64
 Weight for a branch not-taken into a cold block.
static const uint32_t PH_TAKEN_WEIGHT = 20
static const uint32_t PH_NONTAKEN_WEIGHT = 12
static const uint32_t ZH_TAKEN_WEIGHT = 20
static const uint32_t ZH_NONTAKEN_WEIGHT = 12
static const uint32_t FPH_TAKEN_WEIGHT = 20
static const uint32_t FPH_NONTAKEN_WEIGHT = 12
static const uint32_t IH_TAKEN_WEIGHT = 1024 * 1024 - 1
 Invoke-terminating normal branch taken weight.
static const uint32_t IH_NONTAKEN_WEIGHT = 1
 Invoke-terminating normal branch not-taken weight.
static const uint32_t NORMAL_WEIGHT = 16
static const uint32_t MIN_WEIGHT = 1

Define Documentation

#define DEBUG_TYPE   "branch-prob"

Definition at line 27 of file BranchProbabilityInfo.cpp.


Function Documentation

static uint32_t getMaxWeightFor ( BasicBlock BB) [static]

Definition at line 117 of file BranchProbabilityInfo.cpp.

INITIALIZE_PASS_BEGIN ( BranchProbabilityInfo  ,
"branch-prob ,
"Branch Probability Analysis ,
false  ,
true   
)

Variable Documentation

branch Branch Probability Analysis

Definition at line 32 of file BranchProbabilityInfo.cpp.

const uint32_t CC_NONTAKEN_WEIGHT = 64 [static]

Weight for a branch not-taken into a cold block.

This is the weight for a branch not taken toward a block marked cold.

Definition at line 86 of file BranchProbabilityInfo.cpp.

const uint32_t CC_TAKEN_WEIGHT = 4 [static]

Weight for a branch taken going into a cold block.

This is the weight for a branch taken toward a block marked cold. A block is marked cold if it's postdominated by a block containing a call to a cold function. Cold functions are those marked with attribute 'cold'.

Definition at line 80 of file BranchProbabilityInfo.cpp.

branch Branch Probability false

Definition at line 32 of file BranchProbabilityInfo.cpp.

const uint32_t FPH_NONTAKEN_WEIGHT = 12 [static]

Definition at line 95 of file BranchProbabilityInfo.cpp.

const uint32_t FPH_TAKEN_WEIGHT = 20 [static]

Definition at line 94 of file BranchProbabilityInfo.cpp.

const uint32_t IH_NONTAKEN_WEIGHT = 1 [static]

Invoke-terminating normal branch not-taken weight.

This is the weight for branching to the unwind destination of an invoke instruction. This is essentially never taken.

Definition at line 108 of file BranchProbabilityInfo.cpp.

const uint32_t IH_TAKEN_WEIGHT = 1024 * 1024 - 1 [static]

Invoke-terminating normal branch taken weight.

This is the weight for branching to the normal destination of an invoke instruction. We expect this to happen most of the time. Set the weight to an absurdly high value so that nested loops subsume it.

Definition at line 102 of file BranchProbabilityInfo.cpp.

const uint32_t LBH_NONTAKEN_WEIGHT = 4 [static]

Definition at line 58 of file BranchProbabilityInfo.cpp.

const uint32_t LBH_TAKEN_WEIGHT = 124 [static]

Definition at line 57 of file BranchProbabilityInfo.cpp.

const uint32_t MIN_WEIGHT = 1 [static]

Definition at line 115 of file BranchProbabilityInfo.cpp.

const uint32_t NORMAL_WEIGHT = 16 [static]

Definition at line 112 of file BranchProbabilityInfo.cpp.

const uint32_t PH_NONTAKEN_WEIGHT = 12 [static]

Definition at line 89 of file BranchProbabilityInfo.cpp.

const uint32_t PH_TAKEN_WEIGHT = 20 [static]

Definition at line 88 of file BranchProbabilityInfo.cpp.

branch prob

Definition at line 32 of file BranchProbabilityInfo.cpp.

const uint32_t UR_NONTAKEN_WEIGHT = 1024*1024 - 1 [static]

Unreachable-terminating branch not-taken weight.

This is the weight for a branch not being taken toward a block that terminates (eventually) in unreachable. Such a branch is essentially never taken. Set the weight to an absurdly high value so that nested loops don't easily subsume it.

Definition at line 72 of file BranchProbabilityInfo.cpp.

const uint32_t UR_TAKEN_WEIGHT = 1 [static]

Unreachable-terminating branch taken weight.

This is the weight for a branch being taken to a block that terminates (eventually) in unreachable. These are predicted as unlikely as possible.

Definition at line 64 of file BranchProbabilityInfo.cpp.

const uint32_t ZH_NONTAKEN_WEIGHT = 12 [static]

Definition at line 92 of file BranchProbabilityInfo.cpp.

const uint32_t ZH_TAKEN_WEIGHT = 20 [static]

Definition at line 91 of file BranchProbabilityInfo.cpp.