class ResourcePriorityQueue

Declaration

class ResourcePriorityQueue : public SchedulingPriorityQueue { /* full declaration omitted */ };

Description

This interface is used to plug different priorities computation algorithms into the list scheduler. It implements the interface of a standard priority queue, where nodes are inserted in arbitrary order and returned in priority order. The computation of the priority and the representation of the queue are totally up to the implementation to decide.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:37

Inherits from: SchedulingPriorityQueue

Member Variables

private std::vector<SUnit>* SUnits
SUnits - The SUnits for the current graph.
private std::vector<unsigned int> NumNodesSolelyBlocking
NumNodesSolelyBlocking - This vector contains, for every node in the Queue, the number of nodes that the node is the sole unscheduled predecessor for. This is used as a tie-breaker heuristic for better mobility.
private std::vector<SUnit*> Queue
Queue - The queue.
private std::vector<unsigned int> RegPressure
RegPressure - Tracking current reg pressure per register class.
private std::vector<unsigned int> RegLimit
RegLimit - Tracking the number of allocatable registers per register class.
private llvm::resource_sort Picker
private const llvm::TargetRegisterInfo* TRI
private const llvm::TargetLowering* TLI
private const llvm::TargetInstrInfo* TII
private const llvm::InstrItineraryData* InstrItins
private std::unique_ptr<DFAPacketizer> ResourcesModel
ResourcesModel - Represents VLIW state. Not limited to VLIW targets per say, but assumes definition of DFA by a target.
private std::vector<SUnit*> Packet
Resource model - packet/bundle model. Purely internal at the time.
private unsigned int ParallelLiveRanges
Heuristics for estimating register pressure.
private int HorizontalVerticalBalance

Method Overview

Inherited from SchedulingPriorityQueue:

Methods

ResourcePriorityQueue(llvm::SelectionDAGISel* IS)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:77

Parameters

llvm::SelectionDAGISel* IS

int SUSchedulingCost(llvm::SUnit* SU)

Description

Single cost function reflecting benefit of scheduling SU in the current cycle.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:105

Parameters

llvm::SUnit* SU

void addNode(const llvm::SUnit* SU)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:83

Parameters

const llvm::SUnit* SU

void adjustPriorityOfUnscheduledPreds(
    llvm::SUnit* SU)

Description

adjustPriorityOfUnscheduledPreds - One of the predecessors of SU was just scheduled. If SU is not itself available, then there is at least one predecessor node that has not been scheduled yet. If SU has exactly ONE unscheduled predecessor, we want to increase its priority: it getting scheduled will make this node available, so it is better than some other node of the same priority that will not make a node available.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:127

Parameters

llvm::SUnit* SU

bool empty() const

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:113

unsigned int getLatency(
    unsigned int NodeNum) const

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:93

Parameters

unsigned int NodeNum

unsigned int getNumSolelyBlockNodes(
    unsigned int NodeNum) const

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:98

Parameters

unsigned int NodeNum

llvm::SUnit* getSingleUnscheduledPred(
    llvm::SUnit* SU)

Description

getSingleUnscheduledPred - If there is exactly one unscheduled predecessor of SU, return it, otherwise return null.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:128

Parameters

llvm::SUnit* SU

void initNodes(std::vector<SUnit>& sunits)

Description

Initialize nodes.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:81

Parameters

std::vector<SUnit>& sunits

void initNumRegDefsLeft(llvm::SUnit* SU)

Description

InitNumRegDefsLeft - Determine the # of regs defined by this node.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:109

Parameters

llvm::SUnit* SU

bool isBottomUp() const

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:79

bool isResourceAvailable(llvm::SUnit* SU)

Description

Check if scheduling of this SU is possible in the current packet.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:123

Parameters

llvm::SUnit* SU

unsigned int numberRCValPredInSU(
    llvm::SUnit* SU,
    unsigned int RCId)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:129

Parameters

llvm::SUnit* SU
unsigned int RCId

unsigned int numberRCValSuccInSU(
    llvm::SUnit* SU,
    unsigned int RCId)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:130

Parameters

llvm::SUnit* SU
unsigned int RCId

llvm::SUnit* pop()

Description

Main access point - returns next instructions to be placed in scheduling sequence.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:117

void push(llvm::SUnit* U)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:115

Parameters

llvm::SUnit* U

int rawRegPressureDelta(llvm::SUnit* SU,
                        unsigned int RCId)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:111

Parameters

llvm::SUnit* SU
unsigned int RCId

int regPressureDelta(llvm::SUnit* SU,
                     bool RawPressure = false)

Description

Estimates change in reg pressure from this SU. It is achieved by trivial tracking of defined and used vregs in dependent instructions. The RawPressure flag makes this function to ignore existing reg file sizes, and report raw def/use balance.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:110

Parameters

llvm::SUnit* SU
bool RawPressure = false

void releaseState()

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:89

void remove(llvm::SUnit* SU)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:119

Parameters

llvm::SUnit* SU

void reserveResources(llvm::SUnit* SU)

Description

Keep track of available resources.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:124

Parameters

llvm::SUnit* SU

void scheduledNode(llvm::SUnit* SU)

Description

scheduledNode - Main resource tracking point.

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:122

Parameters

llvm::SUnit* SU

void updateNode(const llvm::SUnit* SU)

Declared at: llvm/include/llvm/CodeGen/ResourcePriorityQueue.h:87

Parameters

const llvm::SUnit* SU