LLVM API Documentation
#include <ResourcePriorityQueue.h>
Public Member Functions | |
ResourcePriorityQueue (SelectionDAGISel *IS) | |
~ResourcePriorityQueue () | |
bool | isBottomUp () const override |
void | initNodes (std::vector< SUnit > &sunits) override |
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 |
signed | SUSchedulingCost (SUnit *SU) |
void | initNumRegDefsLeft (SUnit *SU) |
void | updateNumRegDefsLeft (SUnit *SU) |
signed | regPressureDelta (SUnit *SU, bool RawPressure=false) |
signed | rawRegPressureDelta (SUnit *SU, unsigned RCId) |
bool | empty () const override |
void | push (SUnit *U) override |
SUnit * | pop () override |
void | remove (SUnit *SU) override |
void | dump (ScheduleDAG *DAG) const override |
void | scheduledNode (SUnit *Node) override |
scheduledNode - Main resource tracking point. | |
bool | isResourceAvailable (SUnit *SU) |
void | reserveResources (SUnit *SU) |
Keep track of available resources. |
Definition at line 38 of file ResourcePriorityQueue.h.
Definition at line 44 of file ResourcePriorityQueue.cpp.
References llvm::TargetInstrInfo::CreateTargetScheduleState(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetRegisterInfo::getNumRegClasses(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetRegisterInfo::getRegPressureLimit(), llvm::TargetMachine::getSubtargetImpl(), llvm::SelectionDAGISel::getTargetLowering(), I, llvm::SelectionDAGISel::MF, llvm::TargetRegisterInfo::regclass_begin(), llvm::TargetRegisterInfo::regclass_end(), and llvm::SystemZISD::TM.
llvm::ResourcePriorityQueue::~ResourcePriorityQueue | ( | ) | [inline] |
Definition at line 80 of file ResourcePriorityQueue.h.
void llvm::ResourcePriorityQueue::addNode | ( | const SUnit * | SU | ) | [inline, override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 88 of file ResourcePriorityQueue.h.
void ResourcePriorityQueue::dump | ( | ScheduleDAG * | DAG | ) | const [override, virtual] |
Reimplemented from llvm::SchedulingPriorityQueue.
Definition at line 648 of file ResourcePriorityQueue.cpp.
References llvm::dbgs(), llvm::SUnit::dump(), empty(), llvm::SUnit::getHeight(), and pop().
bool llvm::ResourcePriorityQueue::empty | ( | ) | const [inline, override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 119 of file ResourcePriorityQueue.h.
unsigned llvm::ResourcePriorityQueue::getLatency | ( | unsigned | NodeNum | ) | const [inline] |
Definition at line 98 of file ResourcePriorityQueue.h.
Referenced by llvm::resource_sort::operator()().
unsigned llvm::ResourcePriorityQueue::getNumSolelyBlockNodes | ( | unsigned | NodeNum | ) | const [inline] |
Definition at line 103 of file ResourcePriorityQueue.h.
Referenced by llvm::resource_sort::operator()().
void ResourcePriorityQueue::initNodes | ( | std::vector< SUnit > & | sunits | ) | [override, virtual] |
Initialize nodes.
Implements llvm::SchedulingPriorityQueue.
Definition at line 171 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 550 of file ResourcePriorityQueue.cpp.
References llvm::ISD::CopyFromReg, llvm::MCInstrInfo::get(), llvm::SUnit::getNode(), llvm::MCInstrDesc::getNumDefs(), llvm::TargetOpcode::IMPLICIT_DEF, llvm::ISD::INLINEASM, N, and llvm::SUnit::NumRegDefsLeft.
Referenced by initNodes().
bool llvm::ResourcePriorityQueue::isBottomUp | ( | ) | const [inline, override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 84 of file ResourcePriorityQueue.h.
Check if scheduling of this SU is possible in the current packet.
Definition at line 249 of file ResourcePriorityQueue.cpp.
References llvm::DFAPacketizer::canReserveResources(), llvm::TargetOpcode::EXTRACT_SUBREG, llvm::MCInstrInfo::get(), llvm::SDNode::getGluedNode(), llvm::SDNode::getMachineOpcode(), llvm::SUnit::getNode(), I, llvm::TargetOpcode::IMPLICIT_DEF, llvm::TargetOpcode::INSERT_SUBREG, llvm::SDNode::isMachineOpcode(), llvm::TargetOpcode::REG_SEQUENCE, and llvm::TargetOpcode::SUBREG_TO_REG.
Referenced by reserveResources(), and SUSchedulingCost().
SUnit * ResourcePriorityQueue::pop | ( | ) | [override, virtual] |
Main access point - returns next instructions to be placed in scheduling sequence.
Implements llvm::SchedulingPriorityQueue.
Definition at line 601 of file ResourcePriorityQueue.cpp.
References DisableDFASched, empty(), I, SUSchedulingCost(), and std::swap().
Referenced by dump().
void ResourcePriorityQueue::push | ( | SUnit * | U | ) | [override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 234 of file ResourcePriorityQueue.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SUnit::NodeNum, and llvm::SUnit::Succs.
signed ResourcePriorityQueue::rawRegPressureDelta | ( | SUnit * | SU, |
unsigned | RCId | ||
) |
Definition at line 329 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().
signed 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 363 of file ResourcePriorityQueue.cpp.
References llvm::TargetRegisterClass::getID(), llvm::SUnit::getNode(), I, llvm::SDNode::isMachineOpcode(), rawRegPressureDelta(), llvm::TargetRegisterInfo::regclass_begin(), and llvm::TargetRegisterInfo::regclass_end().
Referenced by SUSchedulingCost().
void llvm::ResourcePriorityQueue::releaseState | ( | ) | [inline, override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 94 of file ResourcePriorityQueue.h.
void ResourcePriorityQueue::remove | ( | SUnit * | SU | ) | [override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 635 of file ResourcePriorityQueue.cpp.
References I, and std::swap().
void ResourcePriorityQueue::reserveResources | ( | SUnit * | SU | ) |
Keep track of available resources.
Definition at line 292 of file ResourcePriorityQueue.cpp.
References llvm::DFAPacketizer::clearResources(), llvm::TargetOpcode::EXTRACT_SUBREG, llvm::MCInstrInfo::get(), llvm::SDNode::getGluedNode(), llvm::SDNode::getMachineOpcode(), llvm::SUnit::getNode(), llvm::TargetOpcode::IMPLICIT_DEF, llvm::TargetOpcode::INSERT_SUBREG, llvm::SDNode::isMachineOpcode(), isResourceAvailable(), llvm::MCSchedModel::IssueWidth, llvm::TargetOpcode::REG_SEQUENCE, llvm::DFAPacketizer::reserveResources(), llvm::InstrItineraryData::SchedModel, and llvm::TargetOpcode::SUBREG_TO_REG.
Referenced by scheduledNode().
void ResourcePriorityQueue::scheduledNode | ( | SUnit * | Node | ) | [override, virtual] |
scheduledNode - Main resource tracking point.
Main resource tracking point.
Reimplemented from llvm::SchedulingPriorityQueue.
Definition at line 474 of file ResourcePriorityQueue.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::DFAPacketizer::clearResources(), llvm::SmallVectorTemplateCommon< T, typename >::end(), 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(), I, llvm::SDNode::isMachineOpcode(), llvm::TargetLoweringBase::isTypeLegal(), numberCtrlDepsInSU(), numberCtrlPredInSU(), llvm::SUnit::NumPreds, llvm::SUnit::NumRegDefsLeft, llvm::SUnit::Preds, reserveResources(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::SUnit::Succs.
signed 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 404 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::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().
void llvm::ResourcePriorityQueue::updateNode | ( | const SUnit * | SU | ) | [inline, override, virtual] |
Implements llvm::SchedulingPriorityQueue.
Definition at line 92 of file ResourcePriorityQueue.h.
void llvm::ResourcePriorityQueue::updateNumRegDefsLeft | ( | SUnit * | SU | ) |