LLVM  15.0.0git
Namespaces | Macros | Functions | Variables
MisExpect.cpp File Reference
#include "llvm/Transforms/Utils/MisExpect.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include <cstdint>
#include <functional>
#include <numeric>
Include dependency graph for MisExpect.cpp:

Go to the source code of this file.

Namespaces

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

Macros

#define DEBUG_TYPE   "misexpect"
 

Functions

Optional< SmallVector< uint32_t, 4 > > llvm::misexpect::extractWeights (Instruction *I, LLVMContext &Ctx)
 
uint32_t llvm::misexpect::clamp (uint64_t value, uint32_t low, uint32_t hi)
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Variables

static cl::opt< bool > llvm::PGOWarnMisExpect ("pgo-warn-misexpect", cl::init(false), cl::Hidden, cl::desc("Use this option to turn on/off " "warnings about incorrect usage of llvm.expect intrinsics."))
 
static cl::opt< unsigned > llvm::MisExpectTolerance ("misexpect-tolerance", cl::init(0), cl::desc("Prevents emiting diagnostics when profile counts are " "within N% of the threshold.."))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "misexpect"

Definition at line 46 of file MisExpect.cpp.