@@ -109,8 +109,16 @@ class SchedBundle {
109109
110110// / The list scheduler.
111111class 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.
112115 ReadyListContainer ReadyList;
116+ // / The dependency graph is used by the scheduler to determine the legal
117+ // / ordering of instructions.
113118 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.
114122 std::optional<BasicBlock::iterator> ScheduleTopItOpt;
115123 // TODO: This is wasting memory in exchange for fast removal using a raw ptr.
116124 DenseMap<SchedBundle *, std::unique_ptr<SchedBundle>> Bndls;
@@ -145,7 +153,11 @@ class Scheduler {
145153public:
146154 Scheduler (AAResults &AA, Context &Ctx) : DAG(AA, Ctx) {}
147155 ~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.
149161 bool trySchedule (ArrayRef<Instruction *> Instrs);
150162 // / Clear the scheduler's state, including the DAG.
151163 void clear () {
0 commit comments