LLVM 22.0.0git
|
#include "llvm/IR/ProfDataUtils.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Support/CommandLine.h"
Go to the source code of this file.
Functions | |
static bool | isTargetMD (const MDNode *ProfData, const char *Name, unsigned MinOps) |
template<typename T, typename = typename std::enable_if<std::is_arithmetic_v<T>>> | |
static void | extractFromBranchWeightMD (const MDNode *ProfileData, SmallVectorImpl< T > &Weights) |
static SmallVector< uint32_t > | fitWeights (ArrayRef< uint64_t > Weights) |
Push the weights right to fit in uint32_t. | |
static bool | hasCountTypeMD (const Instruction &I) |
Variables | |
static constexpr unsigned | MinBWOps = 3 |
static constexpr unsigned | MinVPOps = 5 |
static cl::opt< bool > | ElideAllZeroBranchWeights ("elide-all-zero-branch-weights", cl::init(true)) |
|
static |
Definition at line 69 of file ProfDataUtils.cpp.
References assert(), llvm::mdconst::dyn_extract(), E(), llvm::APInt::getActiveBits(), llvm::getBranchWeightOffset(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::ConstantInt::getValue(), llvm::ConstantInt::getZExtValue(), llvm::isBranchWeightMD(), llvm::SmallVectorImpl< T >::resize(), and T.
Referenced by llvm::extractBranchWeights(), llvm::extractFromBranchWeightMD32(), and llvm::extractFromBranchWeightMD64().
|
static |
Push the weights right to fit in uint32_t.
Definition at line 89 of file ProfDataUtils.cpp.
References llvm::append_range(), llvm::countl_zero(), llvm::max_element(), llvm::Offset, and llvm::ArrayRef< T >::size().
Referenced by llvm::setFittedBranchWeights().
|
static |
Definition at line 136 of file ProfDataUtils.cpp.
References I, llvm::isa(), llvm::isBranchWeightMD(), and llvm::isValueProfileMD().
Referenced by llvm::scaleProfData().
Definition at line 49 of file ProfDataUtils.cpp.
References llvm::dyn_cast(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::isBranchWeightMD(), and llvm::isValueProfileMD().
|
static |
Referenced by llvm::setBranchWeights().
|
staticconstexpr |
Definition at line 42 of file ProfDataUtils.cpp.
Referenced by llvm::isBranchWeightMD().
|
staticconstexpr |
Definition at line 45 of file ProfDataUtils.cpp.
Referenced by llvm::isValueProfileMD().