LLVM
15.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. More... | |
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. More... | |
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. More... | |
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. More... | |
Optional< SmallVector< uint32_t, 4 > > | extractWeights (Instruction *I, LLVMContext &Ctx) |
uint32_t | clamp (uint64_t value, uint32_t low, uint32_t hi) |
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 attatched to the instruction, which are 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 219 of file MisExpect.cpp.
References extractWeights(), 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 attatched to the instruction, which are 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 |
RealWeights | A vector of profile weights for each target block |
IsBackend | A boolean describing if this is Frontend instrumentation |
Definition at line 237 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 attatched to the instruction, which are 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 emiting diagnostics |
Definition at line 228 of file MisExpect.cpp.
References extractWeights(), I, and verifyMisExpect().
Referenced by checkExpectAnnotations().
Definition at line 150 of file MisExpect.cpp.
Referenced by llvm::R600InstrInfo::buildSlotOfVectorInstruction(), llvm::SIInstrInfo::canShrink(), llvm::AMDGPUDisassembler::convertSDWAInst(), llvm::SIInstrInfo::convertToThreeAddress(), llvm::R600InstrInfo::getFlagOp(), getSlotedOps(), optimizeVCMPSaveExecSequence(), and llvm::SIInstrInfo::verifyInstruction().
Optional<SmallVector<uint32_t, 4> > llvm::misexpect::extractWeights | ( | Instruction * | I, |
LLVMContext & | Ctx | ||
) |
Definition at line 122 of file MisExpect.cpp.
References assert(), I, and llvm::None.
Referenced by llvm::applyFlowInference(), checkBackendInstrumentation(), and checkFrontendInstrumentation().
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 158 of file MisExpect.cpp.
References LikelyBranchWeight, llvm::max(), and UnlikelyBranchWeight.
Referenced by checkBackendInstrumentation(), and checkFrontendInstrumentation().