LLVM 22.0.0git
MachineCopyPropagation.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "machine-cp"

Functions

 STATISTIC (NumDeletes, "Number of dead copies deleted")
 STATISTIC (NumCopyForwards, "Number of copy uses forwarded")
 STATISTIC (NumCopyBackwardPropagated, "Number of copy defs backward propagated")
 STATISTIC (SpillageChainsLength, "Length of spillage chains")
 STATISTIC (NumSpillageChains, "Number of spillage chains")
 DEBUG_COUNTER (FwdCounter, "machine-cp-fwd", "Controls which register COPYs are forwarded")
 INITIALIZE_PASS (MachineCopyPropagationLegacy, DEBUG_TYPE, "Machine Copy Propagation Pass", false, false) void MachineCopyPropagation
static bool isNopCopy (const MachineInstr &PreviousCopy, MCRegister Src, MCRegister Def, const TargetRegisterInfo *TRI, const TargetInstrInfo *TII, bool UseCopyInstr)
 Return true if PreviousCopy did copy register Src to register Def.
static bool isBackwardPropagatableCopy (const DestSourcePair &CopyOperands, const MachineRegisterInfo &MRI)
static void LLVM_ATTRIBUTE_UNUSED printSpillReloadChain (DenseMap< MachineInstr *, SmallVector< MachineInstr * > > &SpillChain, DenseMap< MachineInstr *, SmallVector< MachineInstr * > > &ReloadChain, MachineInstr *Leader)

Variables

static cl::opt< boolMCPUseCopyInstr ("mcp-use-is-copy-instr", cl::init(false), cl::Hidden)
static cl::opt< cl::boolOrDefaultEnableSpillageCopyElimination ("enable-spill-copy-elim", cl::Hidden)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "machine-cp"

Definition at line 80 of file MachineCopyPropagation.cpp.

Function Documentation

◆ DEBUG_COUNTER()

DEBUG_COUNTER ( FwdCounter ,
"machine-cp-fwd" ,
"Controls which register COPYs are forwarded"  )

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( MachineCopyPropagationLegacy ,
DEBUG_TYPE ,
"Machine Copy Propagation Pass" ,
false ,
false  )

Definition at line 527 of file MachineCopyPropagation.cpp.

References DEBUG_TYPE, Reg, and TRI.

◆ isBackwardPropagatableCopy()

◆ isNopCopy()

bool isNopCopy ( const MachineInstr & PreviousCopy,
MCRegister Src,
MCRegister Def,
const TargetRegisterInfo * TRI,
const TargetInstrInfo * TII,
bool UseCopyInstr )
static

Return true if PreviousCopy did copy register Src to register Def.

This fact may have been obscured by sub register usage or may not be true at all even though Src and Def are subregisters of the registers used in PreviousCopy. e.g. isNopCopy("ecx = COPY eax", AX, CX) == true isNopCopy("ecx = COPY eax", AH, CL) == false

Definition at line 572 of file MachineCopyPropagation.cpp.

References TII, and TRI.

◆ printSpillReloadChain()

void LLVM_ATTRIBUTE_UNUSED printSpillReloadChain ( DenseMap< MachineInstr *, SmallVector< MachineInstr * > > & SpillChain,
DenseMap< MachineInstr *, SmallVector< MachineInstr * > > & ReloadChain,
MachineInstr * Leader )
static

Definition at line 1260 of file MachineCopyPropagation.cpp.

References E(), I, LLVM_ATTRIBUTE_UNUSED, and MI.

◆ STATISTIC() [1/5]

STATISTIC ( NumCopyBackwardPropagated ,
"Number of copy defs backward propagated"  )

◆ STATISTIC() [2/5]

STATISTIC ( NumCopyForwards ,
"Number of copy uses forwarded"  )

◆ STATISTIC() [3/5]

STATISTIC ( NumDeletes ,
"Number of dead copies deleted"  )

◆ STATISTIC() [4/5]

STATISTIC ( NumSpillageChains ,
"Number of spillage chains"  )

◆ STATISTIC() [5/5]

STATISTIC ( SpillageChainsLength ,
"Length of spillage chains"  )

Variable Documentation

◆ EnableSpillageCopyElimination

cl::opt< cl::boolOrDefault > EnableSpillageCopyElimination("enable-spill-copy-elim", cl::Hidden) ( "enable-spill-copy-elim" ,
cl::Hidden  )
static

◆ MCPUseCopyInstr

cl::opt< bool > MCPUseCopyInstr("mcp-use-is-copy-instr", cl::init(false), cl::Hidden) ( "mcp-use-is-copy-instr" ,
cl::init(false) ,
cl::Hidden  )
static