Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
IfConversion.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "if-converter"

Functions

 STATISTIC (NumSimple, "Number of simple if-conversions performed")
 STATISTIC (NumSimpleFalse, "Number of simple (F) if-conversions performed")
 STATISTIC (NumTriangle, "Number of triangle if-conversions performed")
 STATISTIC (NumTriangleRev, "Number of triangle (R) if-conversions performed")
 STATISTIC (NumTriangleFalse,"Number of triangle (F) if-conversions performed")
 STATISTIC (NumTriangleFRev, "Number of triangle (F/R) if-conversions performed")
 STATISTIC (NumDiamonds, "Number of diamond if-conversions performed")
 STATISTIC (NumForkedDiamonds, "Number of forked-diamond if-conversions performed")
 STATISTIC (NumIfConvBBs, "Number of if-converted blocks")
 STATISTIC (NumDupBBs, "Number of duplicated blocks")
 STATISTIC (NumUnpred, "Number of true blocks of diamonds unpredicated")
static MachineBasicBlockfindFalseBlock (MachineBasicBlock *BB, MachineBasicBlock *TrueBB)
 BB has a fallthrough. Find its 'false' successor given its 'true' successor.
static MachineBasicBlockgetNextBlock (MachineBasicBlock &MBB)
 Returns the next block in the function blocks ordering.
static void verifySameBranchInstructions (MachineBasicBlock *MBB1, MachineBasicBlock *MBB2)
static bool canFallThroughTo (MachineBasicBlock &MBB, MachineBasicBlock &ToMBB)
 Returns true either if ToMBB is the next block after MBB or that all the intervening blocks are empty (given MBB can fall through to its next block).
static void InsertUncondBranch (MachineBasicBlock &MBB, MachineBasicBlock &ToMBB, const TargetInstrInfo *TII)
 Inserts an unconditional branch from MBB to ToMBB.
static void UpdatePredRedefs (MachineInstr &MI, LivePhysRegs &Redefs)
 Behaves like LiveRegUnits::StepForward() but also adds implicit uses to all values defined in MI which are also live/used by MI.
static bool MaySpeculate (const MachineInstr &MI, SmallSet< MCRegister, 4 > &LaterRedefs)

Variables

static cl::opt< int > IfCvtFnStart ("ifcvt-fn-start", cl::init(-1), cl::Hidden)
static cl::opt< int > IfCvtFnStop ("ifcvt-fn-stop", cl::init(-1), cl::Hidden)
static cl::opt< int > IfCvtLimit ("ifcvt-limit", cl::init(-1), cl::Hidden)
static cl::opt< boolDisableSimple ("disable-ifcvt-simple", cl::init(false), cl::Hidden)
static cl::opt< boolDisableSimpleF ("disable-ifcvt-simple-false", cl::init(false), cl::Hidden)
static cl::opt< boolDisableTriangle ("disable-ifcvt-triangle", cl::init(false), cl::Hidden)
static cl::opt< boolDisableTriangleR ("disable-ifcvt-triangle-rev", cl::init(false), cl::Hidden)
static cl::opt< boolDisableTriangleF ("disable-ifcvt-triangle-false", cl::init(false), cl::Hidden)
static cl::opt< boolDisableDiamond ("disable-ifcvt-diamond", cl::init(false), cl::Hidden)
static cl::opt< boolDisableForkedDiamond ("disable-ifcvt-forked-diamond", cl::init(false), cl::Hidden)
static cl::opt< boolIfCvtBranchFold ("ifcvt-branch-fold", cl::init(true), cl::Hidden)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "if-converter"

Definition at line 57 of file IfConversion.cpp.

Function Documentation

◆ canFallThroughTo()

bool canFallThroughTo ( MachineBasicBlock & MBB,
MachineBasicBlock & ToMBB )
static

Returns true either if ToMBB is the next block after MBB or that all the intervening blocks are empty (given MBB can fall through to its next block).

Definition at line 1457 of file IfConversion.cpp.

References E(), llvm::ilist_node_impl< OptionsT >::getIterator(), I, and MBB.

◆ findFalseBlock()

MachineBasicBlock * findFalseBlock ( MachineBasicBlock * BB,
MachineBasicBlock * TrueBB )
static

BB has a fallthrough. Find its 'false' successor given its 'true' successor.

Definition at line 627 of file IfConversion.cpp.

References llvm::MachineBasicBlock::successors().

◆ getNextBlock()

MachineBasicBlock * getNextBlock ( MachineBasicBlock & MBB)
inlinestatic

Returns the next block in the function blocks ordering.

If it is the end, returns NULL.

Definition at line 651 of file IfConversion.cpp.

References E(), I, and MBB.

◆ InsertUncondBranch()

void InsertUncondBranch ( MachineBasicBlock & MBB,
MachineBasicBlock & ToMBB,
const TargetInstrInfo * TII )
static

Inserts an unconditional branch from MBB to ToMBB.

Definition at line 1486 of file IfConversion.cpp.

References MBB, and TII.

◆ MaySpeculate()

bool MaySpeculate ( const MachineInstr & MI,
SmallSet< MCRegister, 4 > & LaterRedefs )
static

Definition at line 2112 of file IfConversion.cpp.

References llvm::SmallSet< T, N, C >::count(), MI, and Reg.

◆ STATISTIC() [1/11]

STATISTIC ( NumDiamonds ,
"Number of diamond if-conversions performed"  )

◆ STATISTIC() [2/11]

STATISTIC ( NumDupBBs ,
"Number of duplicated blocks"  )

◆ STATISTIC() [3/11]

STATISTIC ( NumForkedDiamonds ,
"Number of forked-diamond if-conversions performed"  )

◆ STATISTIC() [4/11]

STATISTIC ( NumIfConvBBs ,
"Number of if-converted blocks"  )

◆ STATISTIC() [5/11]

STATISTIC ( NumSimple ,
"Number of simple if-conversions performed"  )

◆ STATISTIC() [6/11]

STATISTIC ( NumSimpleFalse ,
"Number of simple (F) if-conversions performed"  )

◆ STATISTIC() [7/11]

STATISTIC ( NumTriangle ,
"Number of triangle if-conversions performed"  )

◆ STATISTIC() [8/11]

STATISTIC ( NumTriangleFalse ,
"Number of triangle (F) if-conversions performed"  )

◆ STATISTIC() [9/11]

STATISTIC ( NumTriangleFRev ,
"Number of triangle (F/R) if-conversions performed"  )

◆ STATISTIC() [10/11]

STATISTIC ( NumTriangleRev ,
"Number of triangle (R) if-conversions performed"  )

◆ STATISTIC() [11/11]

STATISTIC ( NumUnpred ,
"Number of true blocks of diamonds unpredicated"  )

◆ UpdatePredRedefs()

◆ verifySameBranchInstructions()

void verifySameBranchInstructions ( MachineBasicBlock * MBB1,
MachineBasicBlock * MBB2 )
static

Variable Documentation

◆ DisableDiamond

cl::opt< bool > DisableDiamond("disable-ifcvt-diamond", cl::init(false), cl::Hidden) ( "disable-ifcvt-diamond" ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableForkedDiamond

cl::opt< bool > DisableForkedDiamond("disable-ifcvt-forked-diamond", cl::init(false), cl::Hidden) ( "disable-ifcvt-forked-diamond" ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableSimple

cl::opt< bool > DisableSimple("disable-ifcvt-simple", cl::init(false), cl::Hidden) ( "disable-ifcvt-simple" ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableSimpleF

cl::opt< bool > DisableSimpleF("disable-ifcvt-simple-false", cl::init(false), cl::Hidden) ( "disable-ifcvt-simple-false" ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableTriangle

cl::opt< bool > DisableTriangle("disable-ifcvt-triangle", cl::init(false), cl::Hidden) ( "disable-ifcvt-triangle" ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableTriangleF

cl::opt< bool > DisableTriangleF("disable-ifcvt-triangle-false", cl::init(false), cl::Hidden) ( "disable-ifcvt-triangle-false" ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableTriangleR

cl::opt< bool > DisableTriangleR("disable-ifcvt-triangle-rev", cl::init(false), cl::Hidden) ( "disable-ifcvt-triangle-rev" ,
cl::init(false) ,
cl::Hidden  )
static

◆ IfCvtBranchFold

cl::opt< bool > IfCvtBranchFold("ifcvt-branch-fold", cl::init(true), cl::Hidden) ( "ifcvt-branch-fold" ,
cl::init(true) ,
cl::Hidden  )
static

◆ IfCvtFnStart

cl::opt< int > IfCvtFnStart("ifcvt-fn-start", cl::init(-1), cl::Hidden) ( "ifcvt-fn-start" ,
cl::init(-1) ,
cl::Hidden  )
static

◆ IfCvtFnStop

cl::opt< int > IfCvtFnStop("ifcvt-fn-stop", cl::init(-1), cl::Hidden) ( "ifcvt-fn-stop" ,
cl::init(-1) ,
cl::Hidden  )
static

◆ IfCvtLimit

cl::opt< int > IfCvtLimit("ifcvt-limit", cl::init(-1), cl::Hidden) ( "ifcvt-limit" ,
cl::init(-1) ,
cl::Hidden  )
static