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

#include "llvm/CodeGen/ResourcePriorityQueue.h"

Inheritance diagram for llvm::ResourcePriorityQueue:
Inheritance graph
[legend]

Public Member Functions

 ResourcePriorityQueue (SelectionDAGISel *IS)
 
bool isBottomUp () const override
 
void initNodes (std::vector< SUnit > &sunits) override
 Initialize nodes.
 
void addNode (const SUnit *SU) override
 
void updateNode (const SUnit *SU) override
 
void releaseState () override
 
unsigned getLatency (unsigned NodeNum) const
 
unsigned getNumSolelyBlockNodes (unsigned NodeNum) const
 
int SUSchedulingCost (SUnit *SU)
 Single cost function reflecting benefit of scheduling SU in the current cycle.
 
void initNumRegDefsLeft (SUnit *SU)
 InitNumRegDefsLeft - Determine the # of regs defined by this node.
 
int regPressureDelta (SUnit *SU, bool RawPressure=false)
 Estimates change in reg pressure from this SU.
 
int rawRegPressureDelta (SUnit *SU, unsigned RCId)
 
bool empty () const override
 
void push (SUnit *U) override
 
SUnitpop () override
 Main access point - returns next instructions to be placed in scheduling sequence.
 
void remove (SUnit *SU) override
 
void scheduledNode (SUnit *SU) override
 scheduledNode - Main resource tracking point.
 
bool isResourceAvailable (SUnit *SU)
 Check if scheduling of this SU is possible in the current packet.
 
void reserveResources (SUnit *SU)
 Keep track of available resources.
 
- Public Member Functions inherited from llvm::SchedulingPriorityQueue
 SchedulingPriorityQueue (bool rf=false)
 
virtual ~SchedulingPriorityQueue ()=default
 
virtual bool isBottomUp () const =0
 
virtual void initNodes (std::vector< SUnit > &SUnits)=0
 
virtual void addNode (const SUnit *SU)=0
 
virtual void updateNode (const SUnit *SU)=0
 
virtual void releaseState ()=0
 
virtual bool empty () const =0
 
bool hasReadyFilter () const
 
virtual bool tracksRegPressure () const
 
virtual bool isReady (SUnit *) const
 
virtual void push (SUnit *U)=0
 
void push_all (const std::vector< SUnit * > &Nodes)
 
virtual SUnitpop ()=0
 
virtual void remove (SUnit *SU)=0
 
virtual void dump (ScheduleDAG *) const
 
virtual void scheduledNode (SUnit *)
 As each node is scheduled, this method is invoked.
 
virtual void unscheduledNode (SUnit *)
 
void setCurCycle (unsigned Cycle)
 
unsigned getCurCycle () const
 

Detailed Description

Definition at line 37 of file ResourcePriorityQueue.h.

Constructor & Destructor Documentation

◆ ResourcePriorityQueue()

ResourcePriorityQueue::ResourcePriorityQueue ( SelectionDAGISel IS)

Member Function Documentation

◆ addNode()

void llvm::ResourcePriorityQueue::addNode ( const SUnit SU)
inlineoverridevirtual

Implements llvm::SchedulingPriorityQueue.

Definition at line 83 of file ResourcePriorityQueue.h.

◆ empty()

bool llvm::ResourcePriorityQueue::empty ( ) const
inlineoverridevirtual

Implements llvm::SchedulingPriorityQueue.

Definition at line 113 of file ResourcePriorityQueue.h.

Referenced by pop().

◆ getLatency()

unsigned llvm::ResourcePriorityQueue::getLatency ( unsigned  NodeNum) const
inline

Definition at line 93 of file ResourcePriorityQueue.h.

References assert().

Referenced by llvm::resource_sort::operator()().

◆ getNumSolelyBlockNodes()

unsigned llvm::ResourcePriorityQueue::getNumSolelyBlockNodes ( unsigned  NodeNum) const
inline

Definition at line 98 of file ResourcePriorityQueue.h.

References assert().

Referenced by llvm::resource_sort::operator()().

◆ initNodes()

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

Initialize nodes.

Implements llvm::SchedulingPriorityQueue.

Definition at line 163 of file ResourcePriorityQueue.cpp.

References initNumRegDefsLeft(), and llvm::SUnit::NodeQueueId.

◆ initNumRegDefsLeft()

void ResourcePriorityQueue::initNumRegDefsLeft ( SUnit SU)

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

Definition at line 533 of file ResourcePriorityQueue.cpp.

References llvm::ISD::CopyFromReg, llvm::MCInstrInfo::get(), llvm::SUnit::getNode(), llvm::MCInstrDesc::getNumDefs(), llvm::ISD::INLINEASM, llvm::ISD::INLINEASM_BR, N, and llvm::SUnit::NumRegDefsLeft.

Referenced by initNodes().

◆ isBottomUp()

bool llvm::ResourcePriorityQueue::isBottomUp ( ) const
inlineoverridevirtual

Implements llvm::SchedulingPriorityQueue.

Definition at line 79 of file ResourcePriorityQueue.h.

◆ isResourceAvailable()

bool ResourcePriorityQueue::isResourceAvailable ( SUnit SU)

◆ pop()

SUnit * ResourcePriorityQueue::pop ( )
overridevirtual

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

Implements llvm::SchedulingPriorityQueue.

Definition at line 585 of file ResourcePriorityQueue.cpp.

References DisableDFASched, empty(), I, SUSchedulingCost(), and std::swap().

◆ push()

void ResourcePriorityQueue::push ( SUnit U)
overridevirtual

◆ rawRegPressureDelta()

int ResourcePriorityQueue::rawRegPressureDelta ( SUnit SU,
unsigned  RCId 
)

◆ regPressureDelta()

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

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.

Definition at line 352 of file ResourcePriorityQueue.cpp.

References llvm::SUnit::getNode(), llvm::SDNode::isMachineOpcode(), rawRegPressureDelta(), and llvm::TargetRegisterInfo::regclasses().

Referenced by SUSchedulingCost().

◆ releaseState()

void llvm::ResourcePriorityQueue::releaseState ( )
inlineoverridevirtual

Implements llvm::SchedulingPriorityQueue.

Definition at line 89 of file ResourcePriorityQueue.h.

◆ remove()

void ResourcePriorityQueue::remove ( SUnit SU)
overridevirtual

Implements llvm::SchedulingPriorityQueue.

Definition at line 617 of file ResourcePriorityQueue.cpp.

References assert(), llvm::find(), I, and std::swap().

◆ reserveResources()

void ResourcePriorityQueue::reserveResources ( SUnit SU)

◆ scheduledNode()

void ResourcePriorityQueue::scheduledNode ( SUnit SU)
overridevirtual

◆ SUSchedulingCost()

int ResourcePriorityQueue::SUSchedulingCost ( SUnit SU)

◆ updateNode()

void llvm::ResourcePriorityQueue::updateNode ( const SUnit SU)
inlineoverridevirtual

Implements llvm::SchedulingPriorityQueue.

Definition at line 87 of file ResourcePriorityQueue.h.


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