LLVM 20.0.0git
Macros | Functions | Variables
FixupStatepointCallerSaved.cpp File Reference

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...

#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"

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 (FixupStatepointCallerSaved, DEBUG_TYPE, "Fixup Statepoint Caller Saved", false, false) INITIALIZE_PASS_END(FixupStatepointCallerSaved
 
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< boolFixupSCSExtendSlotSize ("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< boolPassGCPtrInCSR ("fixup-allow-gcptr-in-csr", cl::Hidden, cl::init(false), cl::desc("Allow passing GC Pointer arguments in callee saved registers"))
 
static cl::opt< boolEnableCopyProp ("fixup-scs-enable-copy-propagation", cl::Hidden, cl::init(true), cl::desc("Enable simple copy propagation during register reloading"))
 
static cl::opt< unsignedMaxStatepointsWithRegs ("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
 

Detailed Description

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.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "fixup-statepoint-caller-saved"

Definition at line 35 of file FixupStatepointCallerSaved.cpp.

Function Documentation

◆ getRegisterSize()

Fixup Statepoint Caller static false unsigned getRegisterSize ( const TargetRegisterInfo TRI,
Register  Reg 
)
static

Definition at line 92 of file FixupStatepointCallerSaved.cpp.

References TRI.

Referenced by performCopyPropagation().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( FixupStatepointCallerSaved  ,
DEBUG_TYPE  ,
"Fixup Statepoint Caller Saved"  ,
false  ,
false   
)

◆ performCopyPropagation()

static Register performCopyPropagation ( Register  Reg,
MachineBasicBlock::iterator RI,
bool IsKill,
const TargetInstrInfo TII,
const TargetRegisterInfo TRI 
)
static

◆ 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"   
)

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 88 of file FixupStatepointCallerSaved.cpp.

◆ 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

Referenced by performCopyPropagation().

◆ false

Fixup Statepoint Caller false

Definition at line 89 of file FixupStatepointCallerSaved.cpp.

◆ 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

◆ Saved

Fixup Statepoint Caller Saved