Skip to content

Commit cc61929

Browse files
committed
[SandboxVec][Scheduler][NFC] Add comments
1 parent 51f6438 commit cc61929

File tree

1 file changed

+13
-1
lines changed
  • llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer

1 file changed

+13
-1
lines changed

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,16 @@ class SchedBundle {
109109

110110
/// The list scheduler.
111111
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.
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 {
145153
public:
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

Comments
 (0)