LLVM 20.0.0git
|
Functions | |
void | checkBackendInstrumentation (Instruction &I, const llvm::ArrayRef< uint32_t > RealWeights) |
checkBackendInstrumentation - compares PGO counters to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range. | |
void | checkFrontendInstrumentation (Instruction &I, const ArrayRef< uint32_t > ExpectedWeights) |
checkFrontendInstrumentation - compares PGO counters to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range. | |
void | verifyMisExpect (Instruction &I, ArrayRef< uint32_t > RealWeights, const ArrayRef< uint32_t > ExpectedWeights) |
veryifyMisExpect - compares RealWeights to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range. | |
void | checkExpectAnnotations (Instruction &I, const ArrayRef< uint32_t > ExistingWeights, bool IsFrontend) |
checkExpectAnnotations - compares PGO counters to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range. | |
void llvm::misexpect::checkBackendInstrumentation | ( | Instruction & | I, |
const llvm::ArrayRef< uint32_t > | RealWeights | ||
) |
checkBackendInstrumentation - compares PGO counters to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range.
It extracts the expected weights from the MD_prof weights attached to the instruction, which are assumed to come from lowered llvm.expect intrinsics. The RealWeights parameter and the extracted expected weights are then passed to verifyMisexpect() for verification
I | The Instruction being checked |
RealWeights | A vector of profile weights for each target block |
Definition at line 181 of file MisExpect.cpp.
References llvm::extractBranchWeights(), llvm::hasBranchWeightOrigin(), I, and verifyMisExpect().
Referenced by checkExpectAnnotations().
void llvm::misexpect::checkExpectAnnotations | ( | Instruction & | I, |
const ArrayRef< uint32_t > | ExistingWeights, | ||
bool | IsFrontend | ||
) |
checkExpectAnnotations - compares PGO counters to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range.
It extracts the expected weights from the MD_prof weights attached to the instruction, which are assumed to come from lowered llvm.expect intrinsics. The RealWeights parameter and the extracted expected weights are then passed to verifyMisexpect() for verification. It is a thin wrapper around the checkFrontendInstrumentation and checkBackendInstrumentation APIs
I | The Instruction being checked |
ExistingWeights | A vector of profile weights for each target block |
IsFrontend | A boolean describing if this is Frontend instrumentation |
Definition at line 204 of file MisExpect.cpp.
References checkBackendInstrumentation(), checkFrontendInstrumentation(), and I.
Referenced by handleSwitchExpect(), and llvm::setProfMetadata().
void llvm::misexpect::checkFrontendInstrumentation | ( | Instruction & | I, |
const ArrayRef< uint32_t > | ExpectedWeights | ||
) |
checkFrontendInstrumentation - compares PGO counters to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range.
It extracts the expected weights from the MD_prof weights attached to the instruction, which are assumed to come from profiling data attached by the frontend prior to llvm.expect intrinsic lowering. The ExpectedWeights parameter and the extracted real weights are then passed to verifyMisexpect() for verification
I | The Instruction being checked |
ExpectedWeights | A vector of the expected weights for each target block, this determines the threshold values used when emitting diagnostics |
Definition at line 196 of file MisExpect.cpp.
References llvm::extractBranchWeights(), I, and verifyMisExpect().
Referenced by checkExpectAnnotations(), and handleBrSelExpect().
void llvm::misexpect::verifyMisExpect | ( | Instruction & | I, |
ArrayRef< uint32_t > | RealWeights, | ||
const ArrayRef< uint32_t > | ExpectedWeights | ||
) |
veryifyMisExpect - compares RealWeights to the thresholds used for llvm.expect and warns if the PGO counters are outside of the expected range.
I | The Instruction being checked |
RealWeights | A vector of profile weights from the profile data |
ExpectedWeights | A vector of the weights attatch by llvm.expect |
Definition at line 124 of file MisExpect.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), End, llvm::BranchProbability::getBranchProbability(), I, Idx, LikelyBranchWeight, llvm::ArrayRef< T >::size(), and UnlikelyBranchWeight.
Referenced by checkBackendInstrumentation(), and checkFrontendInstrumentation().