LLVM 20.0.0git
Namespaces | Functions
ProfDataUtils.h File Reference

This file contains the declarations for profiling metadata utility functions. More...

#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/Metadata.h"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

bool llvm::hasProfMD (const Instruction &I)
 Checks if an Instruction has MD_prof Metadata.
 
bool llvm::isBranchWeightMD (const MDNode *ProfileData)
 Checks if an MDNode contains Branch Weight Metadata.
 
bool llvm::hasBranchWeightMD (const Instruction &I)
 Checks if an instructions has Branch Weight Metadata.
 
bool llvm::hasValidBranchWeightMD (const Instruction &I)
 Checks if an instructions has valid Branch Weight Metadata.
 
MDNodellvm::getBranchWeightMDNode (const Instruction &I)
 Get the branch weights metadata node.
 
MDNodellvm::getValidBranchWeightMDNode (const Instruction &I)
 Get the valid branch weights metadata node.
 
bool llvm::hasBranchWeightOrigin (const Instruction &I)
 Check if Branch Weight Metadata has an "expected" field from an llvm.expect* intrinsic.
 
bool llvm::hasBranchWeightOrigin (const MDNode *ProfileData)
 Check if Branch Weight Metadata has an "expected" field from an llvm.expect* intrinsic.
 
unsigned llvm::getBranchWeightOffset (const MDNode *ProfileData)
 Return the offset to the first branch weight data.
 
unsigned llvm::getNumBranchWeights (const MDNode &ProfileData)
 
bool llvm::extractBranchWeights (const MDNode *ProfileData, SmallVectorImpl< uint32_t > &Weights)
 Extract branch weights from MD_prof metadata.
 
void llvm::extractFromBranchWeightMD32 (const MDNode *ProfileData, SmallVectorImpl< uint32_t > &Weights)
 Faster version of extractBranchWeights() that skips checks and must only be called with "branch_weights" metadata nodes.
 
void llvm::extractFromBranchWeightMD64 (const MDNode *ProfileData, SmallVectorImpl< uint64_t > &Weights)
 Faster version of extractBranchWeights() that skips checks and must only be called with "branch_weights" metadata nodes.
 
bool llvm::extractBranchWeights (const Instruction &I, SmallVectorImpl< uint32_t > &Weights)
 Extract branch weights attatched to an Instruction.
 
bool llvm::extractBranchWeights (const Instruction &I, uint64_t &TrueVal, uint64_t &FalseVal)
 Extract branch weights from a conditional branch or select Instruction.
 
bool llvm::extractProfTotalWeight (const MDNode *ProfileData, uint64_t &TotalWeights)
 Retrieve the total of all weights from MD_prof data.
 
bool llvm::extractProfTotalWeight (const Instruction &I, uint64_t &TotalWeights)
 Retrieve the total of all weights from an instruction.
 
void llvm::setBranchWeights (Instruction &I, ArrayRef< uint32_t > Weights, bool IsExpected)
 Create a new branch_weights metadata node and add or overwrite a prof metadata reference to instruction I.
 
void llvm::scaleProfData (Instruction &I, uint64_t S, uint64_t T)
 Scaling the profile data attached to 'I' using the ratio of S/T.
 

Detailed Description

This file contains the declarations for profiling metadata utility functions.

Definition in file ProfDataUtils.h.