LLVM 20.0.0git
|
#include "llvm/CodeGen/ResourcePriorityQueue.h"
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 |
SUnit * | pop () 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 SUnit * | pop ()=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 |
Definition at line 37 of file ResourcePriorityQueue.h.
ResourcePriorityQueue::ResourcePriorityQueue | ( | SelectionDAGISel * | IS | ) |
Definition at line 43 of file ResourcePriorityQueue.cpp.
References assert(), llvm::TargetInstrInfo::CreateTargetScheduleState(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetRegisterInfo::getNumRegClasses(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetRegisterInfo::getRegPressureLimit(), llvm::MachineFunction::getSubtarget(), llvm::SelectionDAGISel::MF, llvm::TargetRegisterInfo::regclasses(), and llvm::SelectionDAGISel::TLI.
Implements llvm::SchedulingPriorityQueue.
Definition at line 83 of file ResourcePriorityQueue.h.
|
inlineoverridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 113 of file ResourcePriorityQueue.h.
Referenced by pop().
Definition at line 93 of file ResourcePriorityQueue.h.
References assert().
Referenced by llvm::resource_sort::operator()().
Definition at line 98 of file ResourcePriorityQueue.h.
References assert().
Referenced by llvm::resource_sort::operator()().
|
overridevirtual |
Initialize nodes.
Implements llvm::SchedulingPriorityQueue.
Definition at line 163 of file ResourcePriorityQueue.cpp.
References initNumRegDefsLeft(), and llvm::SUnit::NodeQueueId.
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().
|
inlineoverridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 79 of file ResourcePriorityQueue.h.
Check if scheduling of this SU is possible in the current packet.
Definition at line 238 of file ResourcePriorityQueue.cpp.
References llvm::MCInstrInfo::get(), llvm::SDNode::getGluedNode(), llvm::SDNode::getMachineOpcode(), llvm::SUnit::getNode(), llvm::SDep::getSUnit(), llvm::SDep::isCtrl(), and llvm::SDNode::isMachineOpcode().
Referenced by reserveResources(), and SUSchedulingCost().
|
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().
|
overridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 224 of file ResourcePriorityQueue.cpp.
References llvm::SDep::getSUnit(), llvm::SUnit::NodeNum, and llvm::SUnit::Succs.
Definition at line 318 of file ResourcePriorityQueue.cpp.
References llvm::TargetRegisterClass::getID(), llvm::SUnit::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), llvm::TargetLoweringBase::getRegClassFor(), llvm::SDNode::getSimpleValueType(), llvm::SDNode::isMachineOpcode(), and llvm::TargetLoweringBase::isTypeLegal().
Referenced by regPressureDelta().
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().
|
inlineoverridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 89 of file ResourcePriorityQueue.h.
|
overridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 617 of file ResourcePriorityQueue.cpp.
References assert(), llvm::find(), I, and std::swap().
void ResourcePriorityQueue::reserveResources | ( | SUnit * | SU | ) |
Keep track of available resources.
Definition at line 281 of file ResourcePriorityQueue.cpp.
References llvm::MCInstrInfo::get(), llvm::SDNode::getGluedNode(), llvm::SDNode::getMachineOpcode(), llvm::SUnit::getNode(), llvm::SDNode::isMachineOpcode(), isResourceAvailable(), llvm::MCSchedModel::IssueWidth, and llvm::InstrItineraryData::SchedModel.
Referenced by scheduledNode().
|
overridevirtual |
scheduledNode - Main resource tracking point.
Main resource tracking point.
Reimplemented from llvm::SchedulingPriorityQueue.
Definition at line 459 of file ResourcePriorityQueue.cpp.
References llvm::TargetRegisterClass::getID(), llvm::SUnit::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), llvm::TargetLoweringBase::getRegClassFor(), llvm::SDNode::getSimpleValueType(), llvm::SDep::getSUnit(), llvm::SDep::isCtrl(), llvm::SDNode::isMachineOpcode(), llvm::TargetLoweringBase::isTypeLegal(), numberCtrlDepsInSU(), numberCtrlPredInSU(), llvm::SUnit::NumPreds, llvm::SUnit::NumRegDefsLeft, llvm::SUnit::Preds, reserveResources(), and llvm::SUnit::Succs.
int ResourcePriorityQueue::SUSchedulingCost | ( | SUnit * | SU | ) |
Single cost function reflecting benefit of scheduling SU in the current cycle.
Returns single number reflecting benefit of scheduling SU in the current cycle.
Definition at line 388 of file ResourcePriorityQueue.cpp.
References llvm::ISD::CopyFromReg, llvm::ISD::CopyToReg, FactorOne, llvm::MCInstrInfo::get(), llvm::SUnit::getHeight(), llvm::SUnit::getNode(), llvm::ISD::INLINEASM, llvm::ISD::INLINEASM_BR, llvm::MCInstrDesc::isCall(), isResourceAvailable(), llvm::SUnit::isScheduled, llvm::SUnit::isScheduleHigh, N, llvm::SUnit::NodeNum, PriorityFour, PriorityOne, PriorityThree, PriorityTwo, regPressureDelta(), RegPressureThreshold, ScaleOne, ScaleThree, ScaleTwo, and llvm::ISD::TokenFactor.
Referenced by pop().
Implements llvm::SchedulingPriorityQueue.
Definition at line 87 of file ResourcePriorityQueue.h.