LLVM: lib/CodeGen/FixupStatepointCallerSaved.cpp File Reference (original ) (raw )Statepoint instruction in deopt parameters contains values which are meaningful to the runtime and should be able to be read at the moment the call returns. More...
Go to the source code of this file.
Macros
#define
DEBUG_TYPE "fixup-statepoint-caller-saved"
Functions
STATISTIC (NumSpilledRegisters, "Number of spilled register")
STATISTIC (NumSpillSlotsAllocated, "Number of spill slots allocated")
STATISTIC (NumSpillSlotsExtended, "Number of spill slots extended")
INITIALIZE_PASS_BEGIN (FixupStatepointCallerSavedLegacy, DEBUG_TYPE , "Fixup Statepoint Caller Saved", false, false) INITIALIZE_PASS_END (FixupStatepointCallerSavedLegacy
Fixup Statepoint Caller static false unsigned
getRegisterSize (const TargetRegisterInfo &TRI , Register Reg )
static Register
performCopyPropagation (Register Reg , MachineBasicBlock::iterator &RI, bool &IsKill, const TargetInstrInfo &TII , const TargetRegisterInfo &TRI )
Variables
static cl::opt < bool >
FixupSCSExtendSlotSize ("fixup-scs-extend-slot-size", cl::Hidden, cl::init(false), cl::desc ("Allow spill in spill slot of greater size than register size"), cl::Hidden)
static cl::opt < bool >
PassGCPtrInCSR ("fixup-allow-gcptr-in-csr", cl::Hidden, cl::init(false), cl::desc ("Allow passing GC Pointer arguments in callee saved registers"))
static cl::opt < bool >
EnableCopyProp ("fixup-scs-enable-copy-propagation", cl::Hidden, cl::init(true), cl::desc ("Enable simple copy propagation during register reloading"))
static cl::opt < unsigned >
MaxStatepointsWithRegs ("fixup-max-csr-statepoints", cl::Hidden, cl::desc ("Max number of statepoints allowed to pass GC Ptrs in registers"))
DEBUG_TYPE
Fixup Statepoint Caller
Saved
Fixup Statepoint Caller
false
Statepoint instruction in deopt parameters contains values which are meaningful to the runtime and should be able to be read at the moment the call returns.
So we can say that we need to encode the fact that these values are "late read" by runtime. If we could express this notion for register allocator it would produce the right form for us. The need to fixup (i.e this pass) is specifically handling the fact that we cannot describe such a late read for the register allocator. Register allocator may put the value on a register clobbered by the call. This pass forces the spill of such registers and replaces corresponding statepoint operands to added spill slots.
Definition in file FixupStatepointCallerSaved.cpp .
◆ DEBUG_TYPE#define DEBUG_TYPE "fixup-statepoint-caller-saved"
◆ getRegisterSize()◆ INITIALIZE_PASS_BEGIN()
INITIALIZE_PASS_BEGIN
(
FixupStatepointCallerSavedLegacy
,
DEBUG_TYPE
,
"Fixup Statepoint Caller Saved"
,
false
,
false
)
Definition at line 115 of file FixupStatepointCallerSaved.cpp .
References llvm::dbgs() , E() , EnableCopyProp , getRegisterSize() , llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse() , LLVM_DEBUG , MBB , llvm::printReg() , Reg , TII , and TRI .
◆ STATISTIC() [1/3]
STATISTIC
(
NumSpilledRegisters
,
"Number of spilled register"
)
◆ STATISTIC() [2/3]
STATISTIC
(
NumSpillSlotsAllocated
,
"Number of spill slots allocated"
)
◆ STATISTIC() [3/3]
STATISTIC
(
NumSpillSlotsExtended
,
"Number of spill slots extended"
)
◆ DEBUG_TYPE◆ EnableCopyProp
cl::opt < bool > EnableCopyProp("fixup-scs-enable-copy-propagation", cl::Hidden, cl::init(true), cl::desc ("Enable simple copy propagation during register reloading")) ( "fixup-scs-enable-copy-propagation" , cl::Hidden , cl::init(true) , cl::desc ("Enable simple copy propagation during register reloading") )
static
◆ falseFixup Statepoint Caller false
◆ FixupSCSExtendSlotSize
cl::opt < bool > FixupSCSExtendSlotSize("fixup-scs-extend-slot-size", cl::Hidden, cl::init(false), cl::desc ("Allow spill in spill slot of greater size than register size"), cl::Hidden) ( "fixup-scs-extend-slot-size" , cl::Hidden , cl::init(false) , cl::desc ("Allow spill in spill slot of greater size than register size") , cl::Hidden )
static
◆ MaxStatepointsWithRegs
cl::opt < unsigned > MaxStatepointsWithRegs("fixup-max-csr-statepoints", cl::Hidden, cl::desc ("Max number of statepoints allowed to pass GC Ptrs in registers")) ( "fixup-max-csr-statepoints" , cl::Hidden , cl::desc ("Max number of statepoints allowed to pass GC Ptrs in registers") )
static
◆ PassGCPtrInCSR
cl::opt < bool > PassGCPtrInCSR("fixup-allow-gcptr-in-csr", cl::Hidden, cl::init(false), cl::desc ("Allow passing GC Pointer arguments in callee saved registers")) ( "fixup-allow-gcptr-in-csr" , cl::Hidden , cl::init(false) , cl::desc ("Allow passing GC Pointer arguments in callee saved registers") )
static
◆ SavedFixup Statepoint Caller Saved