LLVM 22.0.0git
MipsDelaySlotFiller.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "mips-delay-slot-filler"

Enumerations

enum  CompactBranchPolicy { CB_Never , CB_Optimal , CB_Always }

Functions

 STATISTIC (FilledSlots, "Number of delay slots filled")
 STATISTIC (UsefulSlots, "Number of delay slots filled with instructions that" " are not NOP.")
static bool hasUnoccupiedSlot (const MachineInstr *MI)
 INITIALIZE_PASS (MipsDelaySlotFiller, DEBUG_TYPE, "Fill delay slot for MIPS", false, false) static void insertDelayFiller(Iter Filler
 This function inserts clones of Filler into predecessor blocks.
 for (const auto &I :BrMap)
static void addLiveInRegs (Iter Filler, MachineBasicBlock &MBB)
 This function adds registers Filler defines to MBB's live-in register list.
static int getEquivalentCallShort (int Opcode)

Variables

static cl::opt< boolDisableDelaySlotFiller ("disable-mips-delay-filler", cl::init(false), cl::desc("Fill all delay slots with NOPs."), cl::Hidden)
static cl::opt< boolDisableForwardSearch ("disable-mips-df-forward-search", cl::init(true), cl::desc("Disallow MIPS delay filler to search forward."), cl::Hidden)
static cl::opt< boolDisableSuccBBSearch ("disable-mips-df-succbb-search", cl::init(true), cl::desc("Disallow MIPS delay filler to search successor basic blocks."), cl::Hidden)
static cl::opt< boolDisableBackwardSearch ("disable-mips-df-backward-search", cl::init(false), cl::desc("Disallow MIPS delay filler to search backward."), cl::Hidden)
static cl::opt< CompactBranchPolicyMipsCompactBranchPolicy ("mips-compact-branches", cl::Optional, cl::init(CB_Optimal), cl::desc("MIPS Specific: Compact branch policy."), cl::values(clEnumValN(CB_Never, "never", "Do not use compact branches if possible."), clEnumValN(CB_Optimal, "optimal", "Use compact branches where appropriate (default)."), clEnumValN(CB_Always, "always", "Always use compact branches if possible.")))
const BB2BrMap & BrMap

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mips-delay-slot-filler"

Definition at line 50 of file MipsDelaySlotFiller.cpp.

Enumeration Type Documentation

◆ CompactBranchPolicy

Enumerator
CB_Never 

The policy 'never' may in some circumstances or for some ISAs not be absolutely adhered to.

CB_Optimal 

Optimal is the default and will produce compact branches when delay slots cannot be filled.

CB_Always 

'always' may in some circumstances may not be absolutely adhered to there may not be a corresponding compact form of a branch.

Definition at line 80 of file MipsDelaySlotFiller.cpp.

Function Documentation

◆ addLiveInRegs()

void addLiveInRegs ( Iter Filler,
MachineBasicBlock & MBB )
static

This function adds registers Filler defines to MBB's live-in register list.

Definition at line 317 of file MipsDelaySlotFiller.cpp.

References assert(), llvm::TargetRegisterInfo::getAllocatableSet(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), MBB, and llvm::BitVector::test().

◆ for()

for ( const auto &I :BrMap )

Definition at line 306 of file MipsDelaySlotFiller.cpp.

References llvm::MIBundleBuilder::append(), BrMap, and I.

◆ getEquivalentCallShort()

int getEquivalentCallShort ( int Opcode)
static

Definition at line 574 of file MipsDelaySlotFiller.cpp.

References llvm_unreachable.

◆ hasUnoccupiedSlot()

bool hasUnoccupiedSlot ( const MachineInstr * MI)
static

Definition at line 295 of file MipsDelaySlotFiller.cpp.

References MI.

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( MipsDelaySlotFiller ,
DEBUG_TYPE ,
"Fill delay slot for MIPS" ,
false ,
false  )

This function inserts clones of Filler into predecessor blocks.

References DEBUG_TYPE.

◆ STATISTIC() [1/2]

STATISTIC ( FilledSlots ,
"Number of delay slots filled"  )

◆ STATISTIC() [2/2]

STATISTIC ( UsefulSlots ,
"Number of delay slots filled with instructions that" " are not NOP."  )

Variable Documentation

◆ BrMap

const BB2BrMap& BrMap
Initial value:
{
MachineFunction *MF = Filler->getParent()->getParent()

Definition at line 303 of file MipsDelaySlotFiller.cpp.

Referenced by for().

◆ DisableBackwardSearch

cl::opt< bool > DisableBackwardSearch("disable-mips-df-backward-search", cl::init(false), cl::desc("Disallow MIPS delay filler to search backward."), cl::Hidden) ( "disable-mips-df-backward-search" ,
cl::init(false) ,
cl::desc("Disallow MIPS delay filler to search backward.") ,
cl::Hidden  )
static

◆ DisableDelaySlotFiller

cl::opt< bool > DisableDelaySlotFiller("disable-mips-delay-filler", cl::init(false), cl::desc("Fill all delay slots with NOPs."), cl::Hidden) ( "disable-mips-delay-filler" ,
cl::init(false) ,
cl::desc("Fill all delay slots with NOPs.") ,
cl::Hidden  )
static

◆ DisableForwardSearch

cl::opt< bool > DisableForwardSearch("disable-mips-df-forward-search", cl::init(true), cl::desc("Disallow MIPS delay filler to search forward."), cl::Hidden) ( "disable-mips-df-forward-search" ,
cl::init(true) ,
cl::desc("Disallow MIPS delay filler to search forward.") ,
cl::Hidden  )
static

◆ DisableSuccBBSearch

cl::opt< bool > DisableSuccBBSearch("disable-mips-df-succbb-search", cl::init(true), cl::desc("Disallow MIPS delay filler to search successor basic blocks."), cl::Hidden) ( "disable-mips-df-succbb-search" ,
cl::init(true) ,
cl::desc("Disallow MIPS delay filler to search successor basic blocks.") ,
cl::Hidden  )
static

◆ MipsCompactBranchPolicy

cl::opt< CompactBranchPolicy > MipsCompactBranchPolicy("mips-compact-branches", cl::Optional, cl::init(CB_Optimal), cl::desc("MIPS Specific: Compact branch policy."), cl::values(clEnumValN(CB_Never, "never", "Do not use compact branches if possible."), clEnumValN(CB_Optimal, "optimal", "Use compact branches where appropriate (default)."), clEnumValN(CB_Always, "always", "Always use compact branches if possible."))) ( "mips-compact-branches" ,
cl::Optional ,
cl::init(CB_Optimal) ,
cl::desc("MIPS Specific: Compact branch policy.") ,
cl::values(clEnumValN(CB_Never, "never", "Do not use compact branches if possible."), clEnumValN(CB_Optimal, "optimal", "Use compact branches where appropriate (default)."), clEnumValN(CB_Always, "always", "Always use compact branches if possible."))  )
static