LLVM: include/llvm/CodeGen/ResourcePriorityQueue.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16#ifndef LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H

17#define LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H

18

20

21namespace llvm {

28

29

36

38

39 std::vector *SUnits;

40

41

42

43

44

45 std::vector NumNodesSolelyBlocking;

46

47

48 std::vector<SUnit*> Queue;

49

50

51

52 std::vector RegPressure;

53

54

55

56 std::vector RegLimit;

57

63

64

65

66 std::unique_ptr ResourcesModel;

67

68

69

70 std::vector<SUnit*> Packet;

71

72

73 unsigned ParallelLiveRanges;

74 int HorizontalVerticalBalance;

75

76 public:

79

80 bool isBottomUp() const override { return false; }

81

82 void initNodes(std::vector &sunits) override;

83

85 NumNodesSolelyBlocking.resize(SUnits->size(), 0);

86 }

87

89

91 SUnits = nullptr;

92 }

93

95 assert(NodeNum < (*SUnits).size());

96 return (*SUnits)[NodeNum].getHeight();

97 }

98

100 assert(NodeNum < NumNodesSolelyBlocking.size());

101 return NumNodesSolelyBlocking[NodeNum];

102 }

103

104

105

107

108

109

113

114 bool empty() const override { return Queue.empty(); }

115

117

119

121

122

126

127private:

128 void adjustPriorityOfUnscheduledPreds(SUnit *SU);

129 SUnit *getSingleUnscheduledPred(SUnit *SU);

130 unsigned numberRCValPredInSU (SUnit *SU, unsigned RCId);

131 unsigned numberRCValSuccInSU (SUnit *SU, unsigned RCId);

132 };

133}

134

135#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

Itinerary data supplied by a subtarget to be used by a target.

void push(SUnit *U) override

void scheduledNode(SUnit *SU) override

scheduledNode - Main resource tracking point.

ResourcePriorityQueue(SelectionDAGISel *IS)

void initNodes(std::vector< SUnit > &sunits) override

Initialize nodes.

void releaseState() override

Definition ResourcePriorityQueue.h:90

unsigned getLatency(unsigned NodeNum) const

Definition ResourcePriorityQueue.h:94

void updateNode(const SUnit *SU) override

Definition ResourcePriorityQueue.h:88

bool isBottomUp() const override

Definition ResourcePriorityQueue.h:80

bool empty() const override

Definition ResourcePriorityQueue.h:114

SUnit * pop() override

Main access point - returns next instructions to be placed in scheduling sequence.

int rawRegPressureDelta(SUnit *SU, unsigned RCId)

int regPressureDelta(SUnit *SU, bool RawPressure=false)

Estimates change in reg pressure from this SU.

void remove(SUnit *SU) override

~ResourcePriorityQueue() override

unsigned getNumSolelyBlockNodes(unsigned NodeNum) const

Definition ResourcePriorityQueue.h:99

void reserveResources(SUnit *SU)

Keep track of available resources.

int SUSchedulingCost(SUnit *SU)

Single cost function reflecting benefit of scheduling SU in the current cycle.

void initNumRegDefsLeft(SUnit *SU)

InitNumRegDefsLeft - Determine the # of regs defined by this node.

void addNode(const SUnit *SU) override

Definition ResourcePriorityQueue.h:84

bool isResourceAvailable(SUnit *SU)

Check if scheduling of this SU is possible in the current packet.

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.

Definition ResourcePriorityQueue.h:30

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

Definition ResourcePriorityQueue.h:31

resource_sort(ResourcePriorityQueue *pq)

Definition ResourcePriorityQueue.h:32