|
LLVM 24.0.0git
|
#include "llvm/Analysis/BranchProbabilityInfo.h"#include "AnalysisOptions.h"#include "llvm/ADT/PostOrderIterator.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/SmallVectorExtras.h"#include "llvm/Analysis/ConstantFolding.h"#include "llvm/Analysis/CycleAnalysis.h"#include "llvm/Analysis/PostDominators.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/CFG.h"#include "llvm/IR/Constants.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Metadata.h"#include "llvm/IR/PassManager.h"#include "llvm/IR/ProfDataUtils.h"#include "llvm/IR/Type.h"#include "llvm/IR/Value.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Support/BranchProbability.h"#include "llvm/Support/Casting.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include <cassert>#include <cstdint>#include <utility>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "branch-prob" |
Enumerations | |
| enum class | BlockExecWeight : std::uint32_t { ZERO = 0x0 , LOWEST_NON_ZERO = 0x1 , UNREACHABLE = ZERO , NORETURN = LOWEST_NON_ZERO , UNWIND = LOWEST_NON_ZERO , COLD = 0xffff , DEFAULT = 0xfffff } |
| Set of dedicated "absolute" execution weights for a block. More... | |
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 constexpr BranchProbability | UR_TAKEN_PROB = BranchProbability::getRaw(1) |
| Unreachable-terminating branch taken probability. | |
| static const uint32_t | PH_TAKEN_WEIGHT = 20 |
| Heuristics and lookup tables for non-loop branches: Pointer Heuristics (PH) | |
| static const uint32_t | PH_NONTAKEN_WEIGHT = 12 |
| static const uint32_t | ZH_TAKEN_WEIGHT = 20 |
| Zero Heuristics (ZH) | |
| 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 | FPH_ORD_WEIGHT = 1024 * 1024 - 1 |
| This is the probability for an ordered floating point comparison. | |
| static const uint32_t | FPH_UNO_WEIGHT = 1 |
| This is the probability for an unordered floating point comparison, it means one or two of the operands are NaN. | |
| #define DEBUG_TYPE "branch-prob" |
Definition at line 50 of file BranchProbabilityInfo.cpp.
|
strong |
Set of dedicated "absolute" execution weights for a block.
These weights are meaningful relative to each other and their derivatives only.
Definition at line 135 of file BranchProbabilityInfo.cpp.
|
staticconstexpr |
References FPH_ORD_WEIGHT, and FPH_UNO_WEIGHT.
|
staticconstexpr |
References FPH_ORD_WEIGHT, and FPH_UNO_WEIGHT.
|
staticconstexpr |
References FPH_NONTAKEN_WEIGHT, and FPH_TAKEN_WEIGHT.
|
staticconstexpr |
References FPH_NONTAKEN_WEIGHT, and FPH_TAKEN_WEIGHT.
| INITIALIZE_PASS_BEGIN | ( | BranchProbabilityInfoWrapperPass | , |
| "branch-prob" | , | ||
| "Branch Probability Analysis" | , | ||
| false | , | ||
| true | ) |
References INITIALIZE_PASS_DEPENDENCY.
|
staticconstexpr |
References PH_NONTAKEN_WEIGHT, and PH_TAKEN_WEIGHT.
|
staticconstexpr |
References PH_NONTAKEN_WEIGHT, and PH_TAKEN_WEIGHT.
|
staticconstexpr |
References ZH_NONTAKEN_WEIGHT, and ZH_TAKEN_WEIGHT.
|
staticconstexpr |
References ZH_NONTAKEN_WEIGHT, and ZH_TAKEN_WEIGHT.
| branch Branch Probability Analysis |
Definition at line 59 of file BranchProbabilityInfo.cpp.
| branch Branch Probability false |
Definition at line 59 of file BranchProbabilityInfo.cpp.
Definition at line 115 of file BranchProbabilityInfo.cpp.
Referenced by FPTakenProb(), and FPUntakenProb().
This is the probability for an ordered floating point comparison.
Definition at line 118 of file BranchProbabilityInfo.cpp.
Referenced by FPOrdTakenProb(), and FPOrdUntakenProb().
Definition at line 114 of file BranchProbabilityInfo.cpp.
Referenced by FPTakenProb(), and FPUntakenProb().
This is the probability for an unordered floating point comparison, it means one or two of the operands are NaN.
Usually it is used to test for an exceptional case, so the result is unlikely.
Definition at line 122 of file BranchProbabilityInfo.cpp.
Referenced by FPOrdTakenProb(), and FPOrdUntakenProb().
Definition at line 87 of file BranchProbabilityInfo.cpp.
Definition at line 86 of file BranchProbabilityInfo.cpp.
Definition at line 99 of file BranchProbabilityInfo.cpp.
Referenced by PtrTakenProb(), and PtrUntakenProb().
Heuristics and lookup tables for non-loop branches: Pointer Heuristics (PH)
Definition at line 98 of file BranchProbabilityInfo.cpp.
Referenced by PtrTakenProb(), and PtrUntakenProb().
| branch prob |
Definition at line 58 of file BranchProbabilityInfo.cpp.
|
staticconstexpr |
Unreachable-terminating branch taken probability.
This is the probability for a branch being taken to a block that terminates (eventually) in unreachable. These are predicted as unlikely as possible. All reachable probability will proportionally share the remaining part.
Definition at line 94 of file BranchProbabilityInfo.cpp.
Definition at line 107 of file BranchProbabilityInfo.cpp.
Referenced by ZeroTakenProb(), and ZeroUntakenProb().
Zero Heuristics (ZH)
Definition at line 106 of file BranchProbabilityInfo.cpp.
Referenced by ZeroTakenProb(), and ZeroUntakenProb().