LLVM 20.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/IR/ProfDataUtils.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include <algorithm>
#include <cstdint>
#include <functional>
#include <numeric>

Go to the source code of this file.

Namespaces

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

Macros

#define DEBUG_TYPE   "misexpect"
 

Functions

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.
 
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.
 
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.
 
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.
 

Variables

static cl::opt< boolllvm::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< uint32_tllvm::MisExpectTolerance ("misexpect-tolerance", cl::init(0), cl::desc("Prevents emitting diagnostics when profile counts are " "within N% of the threshold.."))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "misexpect"

Definition at line 48 of file MisExpect.cpp.