16#ifndef LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
17#define LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
26 struct SelectionDAGOptions;
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;
63 const SelectionDAGOptions *Opts;
68 std::unique_ptr<DFAPacketizer> ResourcesModel;
72 std::vector<SUnit*> Packet;
75 unsigned ParallelLiveRanges;
76 int HorizontalVerticalBalance;
84 void initNodes(std::vector<SUnit> &sunits)
override;
87 NumNodesSolelyBlocking.resize(SUnits->size(), 0);
97 assert(NodeNum < (*SUnits).size());
98 return (*SUnits)[NodeNum].getHeight();
102 assert(NodeNum < NumNodesSolelyBlocking.size());
103 return NumNodesSolelyBlocking[NodeNum];
108 int SUSchedulingCost (
SUnit *SU);
112 void initNumRegDefsLeft(
SUnit *SU);
113 int regPressureDelta(
SUnit *SU,
bool RawPressure =
false);
114 int rawRegPressureDelta (
SUnit *SU,
unsigned RCId);
116 bool empty()
const override {
return Queue.empty(); }
118 void push(
SUnit *U)
override;
120 SUnit *pop()
override;
122 void remove(
SUnit *SU)
override;
125 void scheduledNode(
SUnit *SU)
override;
126 bool isResourceAvailable(
SUnit *SU);
127 void reserveResources(
SUnit *SU);
130 void adjustPriorityOfUnscheduledPreds(
SUnit *SU);
132 unsigned numberRCValPredInSU (
SUnit *SU,
unsigned RCId);
133 unsigned numberRCValSuccInSU (
SUnit *SU,
unsigned RCId);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Itinerary data supplied by a subtarget to be used by a target.
ResourcePriorityQueue(SelectionDAGISel *IS)
void releaseState() override
unsigned getLatency(unsigned NodeNum) const
void updateNode(const SUnit *SU) override
bool isBottomUp() const override
bool empty() const override
~ResourcePriorityQueue() override
unsigned getNumSolelyBlockNodes(unsigned NodeNum) const
void addNode(const SUnit *SU) override
Scheduling unit. This is a node in the scheduling DAG.
SchedulingPriorityQueue(bool rf=false)
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
TargetInstrInfo - Interface to description of machine instruction set.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.
Sorting functions for the Available queue.
LLVM_ABI bool operator()(const SUnit *LHS, const SUnit *RHS) const
This heuristic is used if DFA scheduling is not desired for some VLIW platform.
ResourcePriorityQueue * PQ
resource_sort(ResourcePriorityQueue *pq)