Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
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
LLVM_ABI unsigned getNumGcMapEntriesIdx ()
 Get index of number of gc map entries.
LLVM_ABI unsigned getNumAllocaIdx ()
 Get index of number of gc allocas.
LLVM_ABI unsigned getNumGCPtrIdx ()
 Get index of number of GC pointers.
LLVM_ABI int getFirstGCPtrIdx ()
 Get index of first GC pointer operand of -1 if there are none.
LLVM_ABI unsigned getGCPointerMap (SmallVectorImpl< std::pair< unsigned, unsigned > > &GCMap)
 Get vector of base/derived pairs from statepoint.
LLVM_ABI 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 LLVM_ABI 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 159 of file StackMaps.h.

Constructor & Destructor Documentation

◆ StatepointOpers()

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

Definition at line 174 of file StackMaps.h.

Referenced by isFoldableReg().

Member Function Documentation

◆ getCallingConv()

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

Return the calling convention.

Definition at line 218 of file StackMaps.h.

References getCCIdx().

◆ getCallTarget()

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

Return the target of the underlying call.

Definition at line 213 of file StackMaps.h.

Referenced by llvm::LoongArchAsmPrinter::LowerSTATEPOINT().

◆ getCCIdx()

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

Get index of Calling Convention operand.

Definition at line 194 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 124 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 223 of file StackMaps.h.

References getFlagsIdx().

Referenced by hasLiveThroughUse().

◆ getFlagsIdx()

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

Get index of Flags operand.

Definition at line 197 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 134 of file StackMaps.cpp.

References B(), D(), getConstMetaVal(), getNumGcMapEntriesIdx(), and N.

◆ getID()

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

Return the ID for the given statepoint.

Definition at line 205 of file StackMaps.h.

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

◆ getIDPos()

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

Get index of statepoint ID operand.

Definition at line 179 of file StackMaps.h.

◆ getNBytesPos()

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

Get index of Num Patch Bytes operand.

Definition at line 182 of file StackMaps.h.

◆ getNCallArgsPos()

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

Get index of Num Call Arguments operand.

Definition at line 185 of file StackMaps.h.

◆ getNumAllocaIdx()

unsigned StatepointOpers::getNumAllocaIdx ( )

Get index of number of gc allocas.

Definition at line 103 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 225 of file StackMaps.h.

References getNumDeoptArgsIdx().

◆ getNumDeoptArgsIdx()

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

Get index of Number Deopt Arguments operand.

Definition at line 200 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 93 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 113 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 208 of file StackMaps.h.

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

◆ 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 189 of file StackMaps.h.

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 159 of file StackMaps.cpp.

References StatepointOpers().

◆ 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 148 of file StackMaps.cpp.

References getVarIdx().


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