17 #ifndef LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
18 #define LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
28 class ResourcePriorityQueue;
31 struct resource_sort :
public std::binary_function<SUnit*, SUnit*, bool> {
40 std::vector<SUnit> *SUnits;
46 std::vector<unsigned> NumNodesSolelyBlocking;
49 std::vector<SUnit*> Queue;
53 std::vector<unsigned> RegPressure;
57 std::vector<unsigned> RegLimit;
67 std::unique_ptr<DFAPacketizer> ResourcesModel;
71 std::vector<SUnit*> Packet;
74 unsigned ParallelLiveRanges;
75 signed HorizontalVerticalBalance;
82 void initNodes(std::vector<SUnit> &sunits)
override;
85 NumNodesSolelyBlocking.resize(SUnits->size(), 0);
95 assert(NodeNum < (*SUnits).size());
96 return (*SUnits)[NodeNum].getHeight();
100 assert(NodeNum < NumNodesSolelyBlocking.size());
101 return NumNodesSolelyBlocking[NodeNum];
115 bool empty()
const override {
return Queue.empty(); }
121 void remove(
SUnit *SU)
override;
129 void adjustPriorityOfUnscheduledPreds(
SUnit *SU);
131 unsigned numberRCValPredInSU (
SUnit *SU,
unsigned RCId);
132 unsigned numberRCValSuccInSU (
SUnit *SU,
unsigned RCId);
signed rawRegPressureDelta(SUnit *SU, unsigned RCId)
bool empty() const override
void addNode(const SUnit *SU) override
void reserveResources(SUnit *SU)
Keep track of available resources.
SchedulingPriorityQueue - This interface is used to plug different priorities computation algorithms ...
bool isBottomUp() const override
unsigned getLatency(unsigned NodeNum) const
void initNumRegDefsLeft(SUnit *SU)
InitNumRegDefsLeft - Determine the # of regs defined by this node.
void updateNode(const SUnit *SU) override
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
ResourcePriorityQueue(SelectionDAGISel *IS)
Sorting functions for the Available queue.
void releaseState() override
Itinerary data supplied by a subtarget to be used by a target.
TargetInstrInfo - Interface to description of machine instruction set.
unsigned getNumSolelyBlockNodes(unsigned NodeNum) const
void scheduledNode(SUnit *Node) override
scheduledNode - Main resource tracking point.
signed regPressureDelta(SUnit *SU, bool RawPressure=false)
Estimates change in reg pressure from this SU.
void updateNumRegDefsLeft(SUnit *SU)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
signed SUSchedulingCost(SUnit *SU)
Single cost function reflecting benefit of scheduling SU in the current cycle.
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
bool isResourceAvailable(SUnit *SU)
Check if scheduling of this SU is possible in the current packet.
void push(SUnit *U) override
SUnit * pop() override
Main access point - returns next instructions to be placed in scheduling sequence.
ResourcePriorityQueue * PQ
void initNodes(std::vector< SUnit > &sunits) override
Initialize nodes.
bool operator()(const SUnit *left, const SUnit *right) const
This heuristic is used if DFA scheduling is not desired for some VLIW platform.
SUnit - Scheduling unit. This is a node in the scheduling DAG.
resource_sort(ResourcePriorityQueue *pq)