LLVM 22.0.0git
LowerExpectIntrinsic.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "lower-expect-intrinsic"

Functions

 STATISTIC (ExpectIntrinsicsHandled, "Number of 'expect' intrinsic instructions handled")
static std::tuple< uint32_t, uint32_tgetBranchWeight (Intrinsic::ID IntrinsicID, CallInst *CI, int BranchCount)
static bool handleSwitchExpect (SwitchInst &SI)
static void handlePhiDef (CallInst *Expect)
 Handler for PHINodes that define the value argument to an @llvm.expect call.
template<class BrSelInst>
static bool handleBrSelExpect (BrSelInst &BSI)
static bool handleBranchExpect (BranchInst &BI)
static bool lowerExpectIntrinsic (Function &F)

Variables

static cl::opt< uint32_tLikelyBranchWeight ("likely-branch-weight", cl::Hidden, cl::init(2000), cl::desc("Weight of the branch likely to be taken (default = 2000)"))
static cl::opt< uint32_tUnlikelyBranchWeight ("unlikely-branch-weight", cl::Hidden, cl::init(1), cl::desc("Weight of the branch unlikely to be taken (default = 1)"))

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lower-expect-intrinsic"

Definition at line 31 of file LowerExpectIntrinsic.cpp.

Function Documentation

◆ getBranchWeight()

std::tuple< uint32_t, uint32_t > getBranchWeight ( Intrinsic::ID IntrinsicID,
CallInst * CI,
int BranchCount )
static

◆ handleBranchExpect()

bool handleBranchExpect ( BranchInst & BI)
static

◆ handleBrSelExpect()

◆ handlePhiDef()

void handlePhiDef ( CallInst * Expect)
static

◆ handleSwitchExpect()

◆ lowerExpectIntrinsic()

◆ STATISTIC()

STATISTIC ( ExpectIntrinsicsHandled ,
"Number of 'expect' intrinsic instructions handled"  )

Variable Documentation

◆ LikelyBranchWeight

cl::opt< uint32_t > LikelyBranchWeight("likely-branch-weight", cl::Hidden, cl::init(2000), cl::desc("Weight of the branch likely to be taken (default = 2000)")) ( "likely-branch-weight" ,
cl::Hidden ,
cl::init(2000) ,
cl::desc("Weight of the branch likely to be taken (default = 2000)")  )
static

◆ UnlikelyBranchWeight

cl::opt< uint32_t > UnlikelyBranchWeight("unlikely-branch-weight", cl::Hidden, cl::init(1), cl::desc("Weight of the branch unlikely to be taken (default = 1)")) ( "unlikely-branch-weight" ,
cl::Hidden ,
cl::init(1) ,
cl::desc("Weight of the branch unlikely to be taken (default = 1)")  )
static