@@ -73,120 +73,120 @@ DebugMod("postra-sched-debugmod",
73
73
AntiDepBreaker::~AntiDepBreaker () = default ;
74
74
75
75
namespace {
76
- class PostRAScheduler : public MachineFunctionPass {
77
- const TargetInstrInfo *TII = nullptr ;
78
- RegisterClassInfo RegClassInfo;
79
-
80
- public:
81
- static char ID;
82
- PostRAScheduler () : MachineFunctionPass(ID) {}
83
-
84
- void getAnalysisUsage (AnalysisUsage &AU) const override {
85
- AU.setPreservesCFG ();
86
- AU.addRequired <AAResultsWrapperPass>();
87
- AU.addRequired <TargetPassConfig>();
88
- AU.addRequired <MachineDominatorTreeWrapperPass>();
89
- AU.addPreserved <MachineDominatorTreeWrapperPass>();
90
- AU.addRequired <MachineLoopInfoWrapperPass>();
91
- AU.addPreserved <MachineLoopInfoWrapperPass>();
92
- MachineFunctionPass::getAnalysisUsage (AU);
93
- }
76
+ class PostRAScheduler : public MachineFunctionPass {
77
+ const TargetInstrInfo *TII = nullptr ;
78
+ RegisterClassInfo RegClassInfo;
79
+
80
+ public:
81
+ static char ID;
82
+ PostRAScheduler () : MachineFunctionPass(ID) {}
83
+
84
+ void getAnalysisUsage (AnalysisUsage &AU) const override {
85
+ AU.setPreservesCFG ();
86
+ AU.addRequired <AAResultsWrapperPass>();
87
+ AU.addRequired <TargetPassConfig>();
88
+ AU.addRequired <MachineDominatorTreeWrapperPass>();
89
+ AU.addPreserved <MachineDominatorTreeWrapperPass>();
90
+ AU.addRequired <MachineLoopInfoWrapperPass>();
91
+ AU.addPreserved <MachineLoopInfoWrapperPass>();
92
+ MachineFunctionPass::getAnalysisUsage (AU);
93
+ }
94
94
95
- MachineFunctionProperties getRequiredProperties () const override {
96
- return MachineFunctionProperties ().set (
97
- MachineFunctionProperties::Property::NoVRegs);
98
- }
95
+ MachineFunctionProperties getRequiredProperties () const override {
96
+ return MachineFunctionProperties ().set (
97
+ MachineFunctionProperties::Property::NoVRegs);
98
+ }
99
99
100
- bool runOnMachineFunction (MachineFunction &Fn) override ;
101
- };
102
- char PostRAScheduler::ID = 0 ;
100
+ bool runOnMachineFunction (MachineFunction &Fn) override ;
101
+ };
103
102
104
- class SchedulePostRATDList : public ScheduleDAGInstrs {
105
- // / AvailableQueue - The priority queue to use for the available SUnits.
106
- // /
107
- LatencyPriorityQueue AvailableQueue;
103
+ char PostRAScheduler::ID = 0 ;
108
104
109
- // / PendingQueue - This contains all of the instructions whose operands have
110
- // / been issued, but their results are not ready yet (due to the latency of
111
- // / the operation). Once the operands becomes available, the instruction is
112
- // / added to the AvailableQueue.
113
- std::vector<SUnit*> PendingQueue;
105
+ class SchedulePostRATDList : public ScheduleDAGInstrs {
106
+ // / AvailableQueue - The priority queue to use for the available SUnits.
107
+ // /
108
+ LatencyPriorityQueue AvailableQueue;
114
109
115
- // / HazardRec - The hazard recognizer to use.
116
- ScheduleHazardRecognizer *HazardRec;
110
+ // / PendingQueue - This contains all of the instructions whose operands have
111
+ // / been issued, but their results are not ready yet (due to the latency of
112
+ // / the operation). Once the operands becomes available, the instruction is
113
+ // / added to the AvailableQueue.
114
+ std::vector<SUnit *> PendingQueue;
117
115
118
- // / AntiDepBreak - Anti-dependence breaking object, or NULL if none
119
- AntiDepBreaker *AntiDepBreak ;
116
+ // / HazardRec - The hazard recognizer to use.
117
+ ScheduleHazardRecognizer *HazardRec ;
120
118
121
- // / AA - AliasAnalysis for making memory reference queries.
122
- AliasAnalysis *AA ;
119
+ // / AntiDepBreak - Anti-dependence breaking object, or NULL if none
120
+ AntiDepBreaker *AntiDepBreak ;
123
121
124
- // / The schedule. Null SUnit*'s represent noop instructions .
125
- std::vector<SUnit*> Sequence ;
122
+ // / AA - AliasAnalysis for making memory reference queries .
123
+ AliasAnalysis *AA ;
126
124
127
- // / Ordered list of DAG postprocessing steps .
128
- std::vector<std::unique_ptr<ScheduleDAGMutation>> Mutations ;
125
+ // / The schedule. Null SUnit*'s represent noop instructions .
126
+ std::vector<SUnit *> Sequence ;
129
127
130
- // / The index in BB of RegionEnd.
131
- // /
132
- // / This is the instruction number from the top of the current block, not
133
- // / the SlotIndex. It is only used by the AntiDepBreaker.
134
- unsigned EndIndex = 0 ;
128
+ // / Ordered list of DAG postprocessing steps.
129
+ std::vector<std::unique_ptr<ScheduleDAGMutation>> Mutations;
135
130
136
- public:
137
- SchedulePostRATDList (
138
- MachineFunction &MF, MachineLoopInfo &MLI, AliasAnalysis *AA,
139
- const RegisterClassInfo &,
140
- TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
141
- SmallVectorImpl<const TargetRegisterClass *> &CriticalPathRCs);
131
+ // / The index in BB of RegionEnd.
132
+ // /
133
+ // / This is the instruction number from the top of the current block, not
134
+ // / the SlotIndex. It is only used by the AntiDepBreaker.
135
+ unsigned EndIndex = 0 ;
142
136
143
- ~SchedulePostRATDList () override ;
137
+ public:
138
+ SchedulePostRATDList (
139
+ MachineFunction &MF, MachineLoopInfo &MLI, AliasAnalysis *AA,
140
+ const RegisterClassInfo &,
141
+ TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
142
+ SmallVectorImpl<const TargetRegisterClass *> &CriticalPathRCs);
144
143
145
- // / startBlock - Initialize register live-range state for scheduling in
146
- // / this block.
147
- // /
148
- void startBlock (MachineBasicBlock *BB) override ;
144
+ ~SchedulePostRATDList () override ;
149
145
150
- // Set the index of RegionEnd within the current BB.
151
- void setEndIndex (unsigned EndIdx) { EndIndex = EndIdx; }
146
+ // / startBlock - Initialize register live-range state for scheduling in
147
+ // / this block.
148
+ // /
149
+ void startBlock (MachineBasicBlock *BB) override ;
152
150
153
- // / Initialize the scheduler state for the next scheduling region.
154
- void enterRegion (MachineBasicBlock *bb,
155
- MachineBasicBlock::iterator begin,
156
- MachineBasicBlock::iterator end,
157
- unsigned regioninstrs) override ;
151
+ // Set the index of RegionEnd within the current BB.
152
+ void setEndIndex (unsigned EndIdx) { EndIndex = EndIdx; }
158
153
159
- // / Notify that the scheduler has finished scheduling the current region.
160
- void exitRegion () override ;
154
+ // / Initialize the scheduler state for the next scheduling region.
155
+ void enterRegion (MachineBasicBlock *bb, MachineBasicBlock::iterator begin,
156
+ MachineBasicBlock::iterator end,
157
+ unsigned regioninstrs) override ;
161
158
162
- // / Schedule - Schedule the instruction range using list scheduling.
163
- // /
164
- void schedule () override ;
159
+ // / Notify that the scheduler has finished scheduling the current region.
160
+ void exitRegion () override ;
165
161
166
- void EmitSchedule ();
162
+ // / Schedule - Schedule the instruction range using list scheduling.
163
+ // /
164
+ void schedule () override ;
167
165
168
- // / Observe - Update liveness information to account for the current
169
- // / instruction, which will not be scheduled.
170
- // /
171
- void Observe (MachineInstr &MI, unsigned Count);
166
+ void EmitSchedule ();
172
167
173
- // / finishBlock - Clean up register live-range state.
174
- // /
175
- void finishBlock () override ;
168
+ // / Observe - Update liveness information to account for the current
169
+ // / instruction, which will not be scheduled.
170
+ // /
171
+ void Observe (MachineInstr &MI, unsigned Count);
176
172
177
- private:
178
- // / Apply each ScheduleDAGMutation step in order.
179
- void postProcessDAG () ;
173
+ // / finishBlock - Clean up register live-range state.
174
+ // /
175
+ void finishBlock () override ;
180
176
181
- void ReleaseSucc (SUnit *SU, SDep *SuccEdge);
182
- void ReleaseSuccessors (SUnit *SU);
183
- void ScheduleNodeTopDown (SUnit *SU, unsigned CurCycle);
184
- void ListScheduleTopDown ();
177
+ private:
178
+ // / Apply each ScheduleDAGMutation step in order.
179
+ void postProcessDAG ();
185
180
186
- void dumpSchedule () const ;
187
- void emitNoop (unsigned CurCycle);
188
- };
189
- }
181
+ void ReleaseSucc (SUnit *SU, SDep *SuccEdge);
182
+ void ReleaseSuccessors (SUnit *SU);
183
+ void ScheduleNodeTopDown (SUnit *SU, unsigned CurCycle);
184
+ void ListScheduleTopDown ();
185
+
186
+ void dumpSchedule () const ;
187
+ void emitNoop (unsigned CurCycle);
188
+ };
189
+ } // namespace
190
190
191
191
char &llvm::PostRASchedulerID = PostRAScheduler::ID;
192
192
0 commit comments