LLVM 24.0.0git
DelaySlotFiller.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "delay-slot-filler"

Functions

 STATISTIC (FilledSlots, "Number of delay slots filled")
static bool combineRestoreADD (MachineBasicBlock &MBB, MachineBasicBlock::iterator RestoreMI, MachineBasicBlock::iterator AddMI, const TargetInstrInfo *TII)
static bool combineRestoreOR (MachineBasicBlock &MBB, MachineBasicBlock::iterator RestoreMI, MachineBasicBlock::iterator OrMI, const TargetInstrInfo *TII)
static bool combineRestoreSETHIi (MachineBasicBlock::iterator RestoreMI, MachineBasicBlock::iterator SetHiMI, const TargetInstrInfo *TII)
static bool tryCombineRestoreWithPrevInst (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const SparcSubtarget *Subtarget)
static MachineBasicBlock::iterator findRequiredDelayInstr (MachineBasicBlock &MBB, MachineBasicBlock::iterator slot)
 The restore before a tail call must run in its delay slot: jmp reg reads a register of the current window, and call writes o7.
static void insertCallDefsUses (MachineBasicBlock::iterator MI, SmallSet< unsigned, 32 > &RegDefs, SmallSet< unsigned, 32 > &RegUses)
static void insertDefsUses (MachineBasicBlock::iterator MI, SmallSet< unsigned, 32 > &RegDefs, SmallSet< unsigned, 32 > &RegUses, const SparcSubtarget *Subtarget)
static bool IsRegInSet (SmallSet< unsigned, 32 > &RegSet, unsigned Reg, const SparcSubtarget *Subtarget)
static bool delayHasHazard (MachineBasicBlock::iterator candidate, bool &sawLoad, bool &sawStore, SmallSet< unsigned, 32 > &RegDefs, SmallSet< unsigned, 32 > &RegUses, const SparcSubtarget *Subtarget)
static MachineBasicBlock::iterator findDelayInstr (MachineBasicBlock &MBB, MachineBasicBlock::iterator slot, const SparcSubtarget *Subtarget)
static bool runOnMachineBasicBlock (MachineBasicBlock &MBB)
 runOnMachineBasicBlock - Fill in delay slots for the given basic block.
static bool runDelaySlotFillerOnMachineFunction (MachineFunction &MF)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "delay-slot-filler"

Definition at line 31 of file DelaySlotFiller.cpp.

Function Documentation

◆ combineRestoreADD()

bool combineRestoreADD ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator RestoreMI,
MachineBasicBlock::iterator AddMI,
const TargetInstrInfo * TII )
static

Definition at line 63 of file DelaySlotFiller.cpp.

References MBB, TII, and TRI.

Referenced by tryCombineRestoreWithPrevInst().

◆ combineRestoreOR()

bool combineRestoreOR ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator RestoreMI,
MachineBasicBlock::iterator OrMI,
const TargetInstrInfo * TII )
static

Definition at line 103 of file DelaySlotFiller.cpp.

References MBB, TII, and TRI.

Referenced by tryCombineRestoreWithPrevInst().

◆ combineRestoreSETHIi()

bool combineRestoreSETHIi ( MachineBasicBlock::iterator RestoreMI,
MachineBasicBlock::iterator SetHiMI,
const TargetInstrInfo * TII )
static

Definition at line 149 of file DelaySlotFiller.cpp.

References assert(), llvm::isInt(), and TII.

Referenced by tryCombineRestoreWithPrevInst().

◆ delayHasHazard()

bool delayHasHazard ( MachineBasicBlock::iterator candidate,
bool & sawLoad,
bool & sawStore,
SmallSet< unsigned, 32 > & RegDefs,
SmallSet< unsigned, 32 > & RegUses,
const SparcSubtarget * Subtarget )
static

Definition at line 318 of file DelaySlotFiller.cpp.

References IsRegInSet(), and Reg.

Referenced by findDelayInstr().

◆ findDelayInstr()

◆ findRequiredDelayInstr()

MachineBasicBlock::iterator findRequiredDelayInstr ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator slot )
static

The restore before a tail call must run in its delay slot: jmp reg reads a register of the current window, and call writes o7.

For the same reason a leaf call needs the copy of o7 back from g1 that SparcFrameLowering emits.

Definition at line 230 of file DelaySlotFiller.cpp.

References MBB, and Opc.

Referenced by runOnMachineBasicBlock().

◆ insertCallDefsUses()

◆ insertDefsUses()

void insertDefsUses ( MachineBasicBlock::iterator MI,
SmallSet< unsigned, 32 > & RegDefs,
SmallSet< unsigned, 32 > & RegUses,
const SparcSubtarget * Subtarget )
static

◆ IsRegInSet()

bool IsRegInSet ( SmallSet< unsigned, 32 > & RegSet,
unsigned Reg,
const SparcSubtarget * Subtarget )
static

◆ runDelaySlotFillerOnMachineFunction()

◆ runOnMachineBasicBlock()

bool LVLGen::runOnMachineBasicBlock ( MachineBasicBlock & MBB)
static

runOnMachineBasicBlock - Fill in delay slots for the given basic block.

We assume there is only one delay slot per delayed instruction.

Definition at line 456 of file DelaySlotFiller.cpp.

References llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), Changed, D(), findDelayInstr(), findRequiredDelayInstr(), llvm::SparcSubtarget::getCLOpts(), llvm::SparcSubtarget::getInstrInfo(), I, MBB, MI, llvm::None, TII, and tryCombineRestoreWithPrevInst().

Referenced by runDelaySlotFillerOnMachineFunction().

◆ STATISTIC()

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

◆ tryCombineRestoreWithPrevInst()