LLVM  13.0.0git
Macros | Functions | Variables
FixupStatepointCallerSaved.cpp File Reference
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
Include dependency graph for FixupStatepointCallerSaved.cpp:

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

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 39 of file FixupStatepointCallerSaved.cpp.

Function Documentation

◆ getRegisterSize()

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

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

Referenced by performCopyPropagation().

◆ false

Fixup Statepoint Caller false

Definition at line 93 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)
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"))
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"))
static

◆ Saved

Fixup Statepoint Caller Saved

Definition at line 93 of file FixupStatepointCallerSaved.cpp.

Referenced by SimplifyShortImmForm(), and SimplifyShortMoveForm().