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

This class tracks both per-statepoint and per-selectiondag information. More...

#include "CodeGen/SelectionDAG/StatepointLowering.h"

Public Member Functions

 StatepointLoweringState ()=default
 
void startNewStatepoint (SelectionDAGBuilder &Builder)
 Reset all state tracking for a newly encountered safepoint.
 
void clear ()
 Clear the memory usage of this object.
 
SDValue getLocation (SDValue Val)
 Returns the spill location of a value incoming to the current statepoint.
 
void setLocation (SDValue Val, SDValue Location)
 
void scheduleRelocCall (const GCRelocateInst &RelocCall)
 Record the fact that we expect to encounter a given gc_relocate before the next statepoint.
 
void relocCallVisited (const GCRelocateInst &RelocCall)
 Remove this gc_relocate from the list we're expecting to see before the next statepoint.
 
SDValue allocateStackSlot (EVT ValueType, SelectionDAGBuilder &Builder)
 Get a stack slot we can use to store an value of type ValueType.
 
void reserveStackSlot (int Offset)
 
bool isStackSlotAllocated (int Offset)
 

Detailed Description

This class tracks both per-statepoint and per-selectiondag information.

For each statepoint it tracks locations of it's gc valuess (incoming and relocated) and list of gcreloc calls scheduled for visiting (this is used for a debug mode consistency check only). The spill slot tracking works in concert with information in FunctionLoweringInfo.

Definition at line 33 of file StatepointLowering.h.

Constructor & Destructor Documentation

◆ StatepointLoweringState()

llvm::StatepointLoweringState::StatepointLoweringState ( )
default

Member Function Documentation

◆ allocateStackSlot()

SDValue StatepointLoweringState::allocateStackSlot ( EVT  ValueType,
SelectionDAGBuilder Builder 
)

◆ clear()

void StatepointLoweringState::clear ( )

Clear the memory usage of this object.

This is called from SelectionDAGBuilder::clear. We require this is never called in the midst of processing a statepoint sequence.

Definition at line 99 of file StatepointLowering.cpp.

References assert(), and llvm::SmallBitVector::clear().

Referenced by llvm::SelectionDAGBuilder::clear().

◆ getLocation()

SDValue llvm::StatepointLoweringState::getLocation ( SDValue  Val)
inline

Returns the spill location of a value incoming to the current statepoint.

Will return SDValue() if this value hasn't been spilled. Otherwise, the value has already been spilled and no further action is required by the caller.

Definition at line 50 of file StatepointLowering.h.

References I.

Referenced by llvm::SelectionDAGBuilder::LowerAsSTATEPOINT(), reservePreviousStackSlotForValue(), and spillIncomingStatepointValue().

◆ isStackSlotAllocated()

bool llvm::StatepointLoweringState::isStackSlotAllocated ( int  Offset)
inline

◆ relocCallVisited()

void llvm::StatepointLoweringState::relocCallVisited ( const GCRelocateInst RelocCall)
inline

Remove this gc_relocate from the list we're expecting to see before the next statepoint.

If we weren't expecting to see it, we'll report an assertion.

Definition at line 75 of file StatepointLowering.h.

References assert(), llvm::find(), I, and llvm::Value::use_empty().

◆ reserveStackSlot()

void llvm::StatepointLoweringState::reserveStackSlot ( int  Offset)
inline

◆ scheduleRelocCall()

void llvm::StatepointLoweringState::scheduleRelocCall ( const GCRelocateInst RelocCall)
inline

Record the fact that we expect to encounter a given gc_relocate before the next statepoint.

If we don't see it, we'll report an assertion.

Definition at line 66 of file StatepointLowering.h.

References llvm::Value::use_empty().

Referenced by llvm::SelectionDAGBuilder::LowerAsSTATEPOINT().

◆ setLocation()

void llvm::StatepointLoweringState::setLocation ( SDValue  Val,
SDValue  Location 
)
inline

◆ startNewStatepoint()

void StatepointLoweringState::startNewStatepoint ( SelectionDAGBuilder Builder)

Reset all state tracking for a newly encountered safepoint.

Also performs some consistency checking.

Definition at line 86 of file StatepointLowering.cpp.

References assert(), llvm::SmallBitVector::clear(), llvm::SelectionDAGBuilder::FuncInfo, llvm::SmallBitVector::resize(), llvm::SmallVectorBase< Size_T >::size(), and llvm::FunctionLoweringInfo::StatepointStackSlots.

Referenced by llvm::SelectionDAGBuilder::LowerAsSTATEPOINT().


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