LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::StatepointOpers Class Reference

MI-level Statepoint operands. More...

#include "llvm/CodeGen/StackMaps.h"

Public Member Functions

 StatepointOpers (const MachineInstr *MI)
 
unsigned getIDPos () const
 Get index of statepoint ID operand.
 
unsigned getNBytesPos () const
 Get index of Num Patch Bytes operand.
 
unsigned getNCallArgsPos () const
 Get index of Num Call Arguments operand.
 
unsigned getVarIdx () const
 Get starting index of non call related arguments (calling convention, statepoint flags, vm state and gc state).
 
unsigned getCCIdx () const
 Get index of Calling Convention operand.
 
unsigned getFlagsIdx () const
 Get index of Flags operand.
 
unsigned getNumDeoptArgsIdx () const
 Get index of Number Deopt Arguments operand.
 
uint64_t getID () const
 Return the ID for the given statepoint.
 
uint32_t getNumPatchBytes () const
 Return the number of patchable bytes the given statepoint should emit.
 
const MachineOperandgetCallTarget () const
 Return the target of the underlying call.
 
CallingConv::ID getCallingConv () const
 Return the calling convention.
 
uint64_t getFlags () const
 Return the statepoint flags.
 
uint64_t getNumDeoptArgs () const
 
unsigned getNumGcMapEntriesIdx ()
 Get index of number of gc map entries.
 
unsigned getNumAllocaIdx ()
 Get index of number of gc allocas.
 
unsigned getNumGCPtrIdx ()
 Get index of number of GC pointers.
 
int getFirstGCPtrIdx ()
 Get index of first GC pointer operand of -1 if there are none.
 
unsigned getGCPointerMap (SmallVectorImpl< std::pair< unsigned, unsigned > > &GCMap)
 Get vector of base/derived pairs from statepoint.
 
bool isFoldableReg (Register Reg) const
 Return true if Reg is used only in operands which can be folded to stack usage.
 

Static Public Member Functions

static bool isFoldableReg (const MachineInstr *MI, Register Reg)
 Return true if Reg is used only in operands of MI which can be folded to stack usage and MI is a statepoint instruction.
 

Detailed Description

MI-level Statepoint operands.

Statepoint operands take the form: <id>, <num patch bytes >, <num call arguments>, <call target>, [call arguments...], <StackMaps::ConstantOp>, <calling convention>, <StackMaps::ConstantOp>, <statepoint flags>, <StackMaps::ConstantOp>, <num deopt args>, [deopt args...], <StackMaps::ConstantOp>, <num gc pointer args>, [gc pointer args...], <StackMaps::ConstantOp>, <num gc allocas>, [gc allocas args...], <StackMaps::ConstantOp>, <num entries in gc map>, [base/derived pairs] base/derived pairs in gc map are logical indices into <gc pointer args> section. All gc pointers assigned to VRegs produce new value (in form of MI Def operand) and are tied to it.

Definition at line 158 of file StackMaps.h.

Constructor & Destructor Documentation

◆ StatepointOpers()

llvm::StatepointOpers::StatepointOpers ( const MachineInstr MI)
inlineexplicit

Definition at line 173 of file StackMaps.h.

References MI.

Member Function Documentation

◆ getCallingConv()

CallingConv::ID llvm::StatepointOpers::getCallingConv ( ) const
inline

Return the calling convention.

Definition at line 217 of file StackMaps.h.

References getCCIdx(), and MI.

◆ getCallTarget()

const MachineOperand & llvm::StatepointOpers::getCallTarget ( ) const
inline

Return the target of the underlying call.

Definition at line 212 of file StackMaps.h.

References MI.

◆ getCCIdx()

unsigned llvm::StatepointOpers::getCCIdx ( ) const
inline

Get index of Calling Convention operand.

Definition at line 193 of file StackMaps.h.

References getVarIdx().

Referenced by getCallingConv().

◆ getFirstGCPtrIdx()

int StatepointOpers::getFirstGCPtrIdx ( )

Get index of first GC pointer operand of -1 if there are none.

Definition at line 125 of file StackMaps.cpp.

References assert(), getConstMetaVal(), and getNumGCPtrIdx().

Referenced by llvm::MachineInstr::findTiedOperandIdx().

◆ getFlags()

uint64_t llvm::StatepointOpers::getFlags ( ) const
inline

Return the statepoint flags.

Definition at line 222 of file StackMaps.h.

References getFlagsIdx(), and MI.

Referenced by hasLiveThroughUse().

◆ getFlagsIdx()

unsigned llvm::StatepointOpers::getFlagsIdx ( ) const
inline

Get index of Flags operand.

Definition at line 196 of file StackMaps.h.

References getVarIdx().

Referenced by getFlags().

◆ getGCPointerMap()

unsigned StatepointOpers::getGCPointerMap ( SmallVectorImpl< std::pair< unsigned, unsigned > > &  GCMap)

Get vector of base/derived pairs from statepoint.

Elements are indices into GC Pointer operand list (logical). Returns number of elements in GCMap.

Definition at line 135 of file StackMaps.cpp.

References B, D, getConstMetaVal(), llvm::MachineOperand::getImm(), getNumGcMapEntriesIdx(), llvm::MachineInstr::getOperand(), and N.

◆ getID()

uint64_t llvm::StatepointOpers::getID ( ) const
inline

Return the ID for the given statepoint.

Definition at line 204 of file StackMaps.h.

References MI.

Referenced by llvm::StackMaps::recordStatepoint().

◆ getIDPos()

unsigned llvm::StatepointOpers::getIDPos ( ) const
inline

Get index of statepoint ID operand.

Definition at line 178 of file StackMaps.h.

◆ getNBytesPos()

unsigned llvm::StatepointOpers::getNBytesPos ( ) const
inline

Get index of Num Patch Bytes operand.

Definition at line 181 of file StackMaps.h.

◆ getNCallArgsPos()

unsigned llvm::StatepointOpers::getNCallArgsPos ( ) const
inline

Get index of Num Call Arguments operand.

Definition at line 184 of file StackMaps.h.

◆ getNumAllocaIdx()

unsigned StatepointOpers::getNumAllocaIdx ( )

Get index of number of gc allocas.

Definition at line 104 of file StackMaps.cpp.

References getConstMetaVal(), llvm::StackMaps::getNextMetaArgIdx(), and getNumGCPtrIdx().

Referenced by getNumGcMapEntriesIdx().

◆ getNumDeoptArgs()

uint64_t llvm::StatepointOpers::getNumDeoptArgs ( ) const
inline

Definition at line 224 of file StackMaps.h.

References getNumDeoptArgsIdx(), and MI.

◆ getNumDeoptArgsIdx()

unsigned llvm::StatepointOpers::getNumDeoptArgsIdx ( ) const
inline

Get index of Number Deopt Arguments operand.

Definition at line 199 of file StackMaps.h.

References getVarIdx().

Referenced by getNumDeoptArgs(), getNumGCPtrIdx(), and hasLiveThroughUse().

◆ getNumGcMapEntriesIdx()

unsigned StatepointOpers::getNumGcMapEntriesIdx ( )

Get index of number of gc map entries.

Definition at line 94 of file StackMaps.cpp.

References getConstMetaVal(), llvm::StackMaps::getNextMetaArgIdx(), and getNumAllocaIdx().

Referenced by getGCPointerMap().

◆ getNumGCPtrIdx()

unsigned StatepointOpers::getNumGCPtrIdx ( )

Get index of number of GC pointers.

Definition at line 114 of file StackMaps.cpp.

References getConstMetaVal(), llvm::StackMaps::getNextMetaArgIdx(), and getNumDeoptArgsIdx().

Referenced by getFirstGCPtrIdx(), getNumAllocaIdx(), and hasLiveThroughUse().

◆ getNumPatchBytes()

uint32_t llvm::StatepointOpers::getNumPatchBytes ( ) const
inline

Return the number of patchable bytes the given statepoint should emit.

Definition at line 207 of file StackMaps.h.

References MI.

Referenced by llvm::AArch64InstrInfo::getInstSizeInBytes(), and llvm::RISCVInstrInfo::getInstSizeInBytes().

◆ getVarIdx()

unsigned llvm::StatepointOpers::getVarIdx ( ) const
inline

Get starting index of non call related arguments (calling convention, statepoint flags, vm state and gc state).

Definition at line 188 of file StackMaps.h.

References MI.

Referenced by getCCIdx(), getFlagsIdx(), getNumDeoptArgsIdx(), isFoldableReg(), and llvm::StackMaps::recordStatepoint().

◆ isFoldableReg() [1/2]

bool StatepointOpers::isFoldableReg ( const MachineInstr MI,
Register  Reg 
)
static

Return true if Reg is used only in operands of MI which can be folded to stack usage and MI is a statepoint instruction.

Definition at line 160 of file StackMaps.cpp.

References isFoldableReg(), and MI.

◆ isFoldableReg() [2/2]

bool StatepointOpers::isFoldableReg ( Register  Reg) const

Return true if Reg is used only in operands which can be folded to stack usage.

Definition at line 149 of file StackMaps.cpp.

References getVarIdx(), and llvm::MachineInstr::uses().

Referenced by isFoldableReg().


The documentation for this class was generated from the following files: