@@ -109,8 +109,16 @@ class SchedBundle {
109
109
110
110
// / The list scheduler.
111
111
class Scheduler {
112
+ // / This is a list-scheduler and this is the list containing the instructions
113
+ // / that are ready, meaning that all their dependency successors have already
114
+ // / been scheduled.
112
115
ReadyListContainer ReadyList;
116
+ // / The dependency graph is used by the scheduler to determine the legal
117
+ // / ordering of instructions.
113
118
DependencyGraph DAG;
119
+ // / This is the top of the schedule, i.e. the location where the scheduler
120
+ // / is about to place the scheduled instructions. It gets updated as we
121
+ // / schedule.
114
122
std::optional<BasicBlock::iterator> ScheduleTopItOpt;
115
123
// TODO: This is wasting memory in exchange for fast removal using a raw ptr.
116
124
DenseMap<SchedBundle *, std::unique_ptr<SchedBundle>> Bndls;
@@ -145,7 +153,11 @@ class Scheduler {
145
153
public:
146
154
Scheduler (AAResults &AA, Context &Ctx) : DAG(AA, Ctx) {}
147
155
~Scheduler () {}
148
-
156
+ // / Tries to build a schedule that includes all of \p Instrs scheduled at the
157
+ // / same scheduling cycle. This essentially checks that there are no
158
+ // / dependencies among \p Instrs. This function may involve scheduling
159
+ // / intermediate instructions or canceling and re-scheduling if needed.
160
+ // / \Returns true on success, false otherwise.
149
161
bool trySchedule (ArrayRef<Instruction *> Instrs);
150
162
// / Clear the scheduler's state, including the DAG.
151
163
void clear () {
0 commit comments