class StatepointLoweringState

Declaration

class StatepointLoweringState { /* full declaration omitted */ };

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.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:33

Member Variables

private DenseMap<llvm::SDValue, llvm::SDValue> Locations
Maps pre-relocation value (gc pointer directly incoming into statepoint) into it's location (currently only stack slots)
private llvm::SmallBitVector AllocatedStackSlots
A boolean indicator for each slot listed in the FunctionInfo as to whether it has been used in the current statepoint. Since we try to preserve stack slots across safepoints, there can be gaps in which slots have been allocated.
private unsigned int NextSlotToAllocate = 0
Points just beyond the last slot known to have been allocated
private SmallVector<const llvm::GCRelocateInst*, 10> PendingGCRelocateCalls
Keep track of pending gcrelocate calls for consistency check

Method Overview

Methods

StatepointLoweringState()

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:35

llvm::SDValue allocateStackSlot(
    llvm::EVT ValueType,
    llvm::SelectionDAGBuilder& Builder)

Description

Get a stack slot we can use to store an value of type ValueType. This will hopefully be a recylced slot from another statepoint.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:90

Parameters

llvm::EVT ValueType
llvm::SelectionDAGBuilder& Builder

void clear()

Description

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.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:44

llvm::SDValue getLocation(llvm::SDValue Val)

Description

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.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:50

Parameters

llvm::SDValue Val

bool isStackSlotAllocated(int Offset)

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:100

Parameters

int Offset

void relocCallVisited(
    const llvm::GCRelocateInst& RelocCall)

Description

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.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:75

Parameters

const llvm::GCRelocateInst& RelocCall

void reserveStackSlot(int Offset)

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:92

Parameters

int Offset

void scheduleRelocCall(
    const llvm::GCRelocateInst& RelocCall)

Description

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.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:66

Parameters

const llvm::GCRelocateInst& RelocCall

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

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:57

Parameters

llvm::SDValue Val
llvm::SDValue Location

void startNewStatepoint(
    llvm::SelectionDAGBuilder& Builder)

Description

Reset all state tracking for a newly encountered safepoint. Also performs some consistency checking.

Declared at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h:39

Parameters

llvm::SelectionDAGBuilder& Builder