LLVM 22.0.0git
|
Functions | |
void | checkBackendInstrumentation (const Instruction &I, 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 (const Instruction &I, 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 (const Instruction &I, ArrayRef< uint32_t > RealWeights, 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 (const Instruction &I, 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 | ( | const Instruction & | I, |
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 166 of file MisExpect.cpp.
References llvm::extractBranchWeights(), llvm::hasBranchWeightOrigin(), I, and verifyMisExpect().
Referenced by checkExpectAnnotations().
void llvm::misexpect::checkExpectAnnotations | ( | const Instruction & | I, |
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 189 of file MisExpect.cpp.
References checkBackendInstrumentation(), checkFrontendInstrumentation(), and I.
Referenced by handleSwitchExpect(), and llvm::setProfMetadata().
void llvm::misexpect::checkFrontendInstrumentation | ( | const Instruction & | I, |
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 181 of file MisExpect.cpp.
References llvm::extractBranchWeights(), I, and verifyMisExpect().
Referenced by checkExpectAnnotations(), and handleBrSelExpect().
void llvm::misexpect::verifyMisExpect | ( | const Instruction & | I, |
ArrayRef< uint32_t > | RealWeights, | ||
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 110 of file MisExpect.cpp.
References assert(), llvm::ArrayRef< T >::begin(), emitMisexpectDiagnostic(), llvm::ArrayRef< T >::end(), llvm::enumerate(), llvm::BranchProbability::getBranchProbability(), getMisExpectTolerance(), I, LikelyBranchWeight, llvm::ArrayRef< T >::size(), and UnlikelyBranchWeight.
Referenced by checkBackendInstrumentation(), and checkFrontendInstrumentation().