LLVM
8.0.1
|
#include "llvm/CodeGen/ResourcePriorityQueue.h"
Public Member Functions | |
ResourcePriorityQueue (SelectionDAGISel *IS) | |
bool | isBottomUp () const override |
void | initNodes (std::vector< SUnit > &sunits) override |
Initialize nodes. More... | |
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. More... | |
void | initNumRegDefsLeft (SUnit *SU) |
InitNumRegDefsLeft - Determine the # of regs defined by this node. More... | |
void | updateNumRegDefsLeft (SUnit *SU) |
int | regPressureDelta (SUnit *SU, bool RawPressure=false) |
Estimates change in reg pressure from this SU. More... | |
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. More... | |
void | remove (SUnit *SU) override |
void | scheduledNode (SUnit *SU) override |
scheduledNode - Main resource tracking point. More... | |
bool | isResourceAvailable (SUnit *SU) |
Check if scheduling of this SU is possible in the current packet. More... | |
void | reserveResources (SUnit *SU) |
Keep track of available resources. More... | |
Public Member Functions inherited from llvm::SchedulingPriorityQueue | |
SchedulingPriorityQueue (bool rf=false) | |
virtual | ~SchedulingPriorityQueue ()=default |
bool | hasReadyFilter () const |
virtual bool | tracksRegPressure () const |
virtual bool | isReady (SUnit *) const |
void | push_all (const std::vector< SUnit *> &Nodes) |
virtual void | dump (ScheduleDAG *) const |
virtual void | unscheduledNode (SUnit *) |
void | setCurCycle (unsigned Cycle) |
unsigned | getCurCycle () const |
Definition at line 38 of file ResourcePriorityQueue.h.
ResourcePriorityQueue::ResourcePriorityQueue | ( | SelectionDAGISel * | IS | ) |
Definition at line 44 of file ResourcePriorityQueue.cpp.
References assert(), llvm::ISD::CopyFromReg, llvm::ISD::CopyToReg, llvm::TargetInstrInfo::CreateTargetScheduleState(), llvm::TargetRegisterClass::getID(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::SDValue::getNode(), llvm::SUnit::getNode(), llvm::SDNode::getNumOperands(), llvm::TargetRegisterInfo::getNumRegClasses(), llvm::SDNode::getNumValues(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::TargetLoweringBase::getRegClassFor(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetRegisterInfo::getRegPressureLimit(), llvm::SDValue::getResNo(), llvm::SDNode::getSimpleValueType(), llvm::MachineFunction::getSubtarget(), llvm::SDep::getSUnit(), llvm::ISD::INLINEASM, llvm::SDep::isCtrl(), llvm::SDNode::isMachineOpcode(), llvm::TargetLoweringBase::isTypeLegal(), llvm::SelectionDAGISel::MF, llvm::SUnit::Preds, llvm::TargetRegisterInfo::regclasses(), llvm::SUnit::Succs, llvm::SelectionDAGISel::TLI, and llvm::ISD::TokenFactor.
Implements llvm::SchedulingPriorityQueue.
Definition at line 84 of file ResourcePriorityQueue.h.
|
inlineoverridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 115 of file ResourcePriorityQueue.h.
Referenced by pop().
Definition at line 94 of file ResourcePriorityQueue.h.
References assert().
Definition at line 99 of file ResourcePriorityQueue.h.
References assert().
|
overridevirtual |
Initialize nodes.
Implements llvm::SchedulingPriorityQueue.
Definition at line 162 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 532 of file ResourcePriorityQueue.cpp.
References llvm::ISD::CopyFromReg, llvm::MCInstrInfo::get(), llvm::SUnit::getNode(), llvm::MCInstrDesc::getNumDefs(), llvm::ISD::INLINEASM, llvm::SUnit::isAvailable, N, llvm::SUnit::NumRegDefsLeft, and push().
Referenced by initNodes().
|
inlineoverridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 80 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(), 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 583 of file ResourcePriorityQueue.cpp.
References DisableDFASched, E, 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.
Referenced by initNumRegDefsLeft().
Definition at line 318 of file ResourcePriorityQueue.cpp.
References llvm::TargetRegisterClass::getID(), llvm::SDValue::getNode(), llvm::SUnit::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), llvm::TargetLoweringBase::getRegClassFor(), llvm::SDValue::getResNo(), 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 90 of file ResourcePriorityQueue.h.
|
overridevirtual |
Implements llvm::SchedulingPriorityQueue.
Definition at line 615 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 458 of file ResourcePriorityQueue.cpp.
References llvm::TargetRegisterClass::getID(), llvm::SDValue::getNode(), llvm::SUnit::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), llvm::TargetLoweringBase::getRegClassFor(), llvm::SDValue::getResNo(), 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, llvm::MCInstrInfo::get(), llvm::SUnit::getHeight(), llvm::SUnit::getNode(), llvm::ISD::INLINEASM, llvm::MCInstrDesc::isCall(), isResourceAvailable(), llvm::SUnit::isScheduled, llvm::SUnit::isScheduleHigh, N, llvm::SUnit::NodeNum, PriorityFour, PriorityOne, PriorityThree, regPressureDelta(), RegPressureThreshold, ScaleOne, ScaleTwo, and llvm::ISD::TokenFactor.
Referenced by pop().
Implements llvm::SchedulingPriorityQueue.
Definition at line 88 of file ResourcePriorityQueue.h.
void llvm::ResourcePriorityQueue::updateNumRegDefsLeft | ( | SUnit * | SU | ) |