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;
69 std::unique_ptr<DFAPacketizer> ResourcesModel;
73 std::vector<SUnit*> Packet;
76 unsigned ParallelLiveRanges;
77 int HorizontalVerticalBalance;
85 void initNodes(std::vector<SUnit> &sunits)
override;
88 NumNodesSolelyBlocking.resize(SUnits->size(), 0);
98 assert(NodeNum < (*SUnits).size());
99 return (*SUnits)[NodeNum].getHeight();
103 assert(NodeNum < NumNodesSolelyBlocking.size());
104 return NumNodesSolelyBlocking[NodeNum];
109 int SUSchedulingCost (
SUnit *SU);
113 void initNumRegDefsLeft(
SUnit *SU);
114 int regPressureDelta(
SUnit *SU,
bool RawPressure =
false);
115 int rawRegPressureDelta (
SUnit *SU,
unsigned RCId);
117 bool empty()
const override {
return Queue.empty(); }
119 void push(
SUnit *U)
override;
121 SUnit *pop()
override;
123 void remove(
SUnit *SU)
override;
126 void scheduledNode(
SUnit *SU)
override;
127 bool isResourceAvailable(
SUnit *SU);
128 void reserveResources(
SUnit *SU);
131 void adjustPriorityOfUnscheduledPreds(
SUnit *SU);
133 unsigned numberRCValPredInSU (
SUnit *SU,
unsigned RCId);
134 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)