LLVM 23.0.0git
EarlyIfConversion.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "early-ifcvt"
#define DEBUG_TYPE   "early-if-predicator"

Functions

 STATISTIC (NumDiamondsSeen, "Number of diamonds")
 STATISTIC (NumDiamondsConv, "Number of diamonds converted")
 STATISTIC (NumTrianglesSeen, "Number of triangles")
 STATISTIC (NumTrianglesConv, "Number of triangles converted")
 STATISTIC (NumDataDependant, "Number of data dependent conditional branches encountered")
 STATISTIC (NumLikelyBiased, "Number of branches with a hot path encountered")
static bool hasSameValue (const MachineRegisterInfo &MRI, const TargetInstrInfo *TII, Register TReg, Register FReg)
 INITIALIZE_PASS_BEGIN (EarlyIfConverterLegacy, DEBUG_TYPE, "Early If Converter", false, false) INITIALIZE_PASS_END(EarlyIfConverterLegacy
static bool isConstantPoolLoad (const MachineInstr *MI)
static bool callInRange (const MachineInstr *From, const MachineInstr *To)
 Check if there are any calls in the range (From, To].
static unsigned adjCycles (unsigned Cyc, int Delta)
 INITIALIZE_PASS_BEGIN (EarlyIfPredicator, DEBUG_TYPE, "Early If Predicator", false, false) INITIALIZE_PASS_END(EarlyIfPredicator

Variables

static cl::opt< unsignedBlockInstrLimit ("early-ifcvt-limit", cl::init(30), cl::Hidden, cl::desc("Maximum number of instructions per speculated block."))
static cl::opt< boolStress ("stress-early-ifcvt", cl::Hidden, cl::desc("Turn all knobs to 11"))
static cl::opt< boolEnableDataDependentBranchAnalysis ("enable-early-ifcvt-data-dependent", cl::Hidden, cl::init(false), cl::desc("Enable hard-to-predict branch analysis for if-conversion"))
static cl::opt< unsignedMaxNumSteps ("early-ifcvt-max-steps", cl::Hidden, cl::init(16), cl::desc("Limit the number of steps taken when searching for a " "recently loaded value"))
 DEBUG_TYPE
Early If Converter
Early If false
Early If Predicator

Macro Definition Documentation

◆ DEBUG_TYPE [1/2]

#define DEBUG_TYPE   "early-ifcvt"

Definition at line 48 of file EarlyIfConversion.cpp.

◆ DEBUG_TYPE [2/2]

#define DEBUG_TYPE   "early-if-predicator"

Definition at line 48 of file EarlyIfConversion.cpp.

Function Documentation

◆ adjCycles()

unsigned adjCycles ( unsigned Cyc,
int Delta )
static

Definition at line 1029 of file EarlyIfConversion.cpp.

◆ callInRange()

bool callInRange ( const MachineInstr * From,
const MachineInstr * To )
static

Check if there are any calls in the range (From, To].

Definition at line 927 of file EarlyIfConversion.cpp.

References llvm::any_of(), llvm::Count, llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::make_range(), and MI.

◆ hasSameValue()

◆ INITIALIZE_PASS_BEGIN() [1/2]

INITIALIZE_PASS_BEGIN ( EarlyIfConverterLegacy ,
DEBUG_TYPE ,
"Early If Converter" ,
false ,
false  )

◆ INITIALIZE_PASS_BEGIN() [2/2]

INITIALIZE_PASS_BEGIN ( EarlyIfPredicator ,
DEBUG_TYPE ,
"Early If Predicator" ,
false ,
false  )

◆ isConstantPoolLoad()

bool isConstantPoolLoad ( const MachineInstr * MI)
static

Definition at line 919 of file EarlyIfConversion.cpp.

References llvm::any_of(), and MI.

◆ STATISTIC() [1/6]

STATISTIC ( NumDataDependant ,
"Number of data dependent conditional branches encountered"  )

◆ STATISTIC() [2/6]

STATISTIC ( NumDiamondsConv ,
"Number of diamonds converted"  )

◆ STATISTIC() [3/6]

STATISTIC ( NumDiamondsSeen ,
"Number of diamonds"  )

◆ STATISTIC() [4/6]

STATISTIC ( NumLikelyBiased ,
"Number of branches with a hot path encountered"  )

References MRI, llvm::CallingConv::Tail, TBB, TII, and TRI.

◆ STATISTIC() [5/6]

STATISTIC ( NumTrianglesConv ,
"Number of triangles converted"  )

◆ STATISTIC() [6/6]

STATISTIC ( NumTrianglesSeen ,
"Number of triangles"  )

Variable Documentation

◆ BlockInstrLimit

cl::opt< unsigned > BlockInstrLimit("early-ifcvt-limit", cl::init(30), cl::Hidden, cl::desc("Maximum number of instructions per speculated block.")) ( "early-ifcvt-limit" ,
cl::init(30) ,
cl::Hidden ,
cl::desc("Maximum number of instructions per speculated block.")  )
static

◆ Converter

Early If Converter

Definition at line 866 of file EarlyIfConversion.cpp.

Referenced by createInterfaceFile().

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 866 of file EarlyIfConversion.cpp.

◆ EnableDataDependentBranchAnalysis

cl::opt< bool > EnableDataDependentBranchAnalysis("enable-early-ifcvt-data-dependent", cl::Hidden, cl::init(false), cl::desc("Enable hard-to-predict branch analysis for if-conversion")) ( "enable-early-ifcvt-data-dependent" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Enable hard-to-predict branch analysis for if-conversion")  )
static

◆ false

Early If false

Definition at line 867 of file EarlyIfConversion.cpp.

◆ MaxNumSteps

cl::opt< unsigned > MaxNumSteps("early-ifcvt-max-steps", cl::Hidden, cl::init(16), cl::desc("Limit the number of steps taken when searching for a " "recently loaded value")) ( "early-ifcvt-max-steps" ,
cl::Hidden ,
cl::init(16) ,
cl::desc("Limit the number of steps taken when searching for a " "recently loaded value")  )
static

◆ Predicator

Early If Predicator

◆ Stress

cl::opt< bool > Stress("stress-early-ifcvt", cl::Hidden, cl::desc("Turn all knobs to 11")) ( "stress-early-ifcvt" ,
cl::Hidden ,
cl::desc("Turn all knobs to 11")  )
static

Referenced by shouldConvertImpl().