Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,13 @@ class DependencyGraph {
DAGInterval = {};
}
#ifndef NDEBUG
/// \Returns true if the DAG's state is clear. Used in assertions.
bool empty() const {
bool IsEmpty = InstrToNodeMap.empty();
assert(IsEmpty == DAGInterval.empty() &&
"Interval and InstrToNodeMap out of sync!");
return IsEmpty;
}
void print(raw_ostream &OS) const;
LLVM_DUMP_METHOD void dump() const;
#endif // NDEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ class Scheduler {
Bndls.clear();
// TODO: clear view once it lands.
DAG.clear();
ReadyList.clear();
ScheduleTopItOpt = std::nullopt;
assert(Bndls.empty() && DAG.empty() && ReadyList.empty() &&
!ScheduleTopItOpt && "Expected empty state!");
}

#ifndef NDEBUG
Expand Down
Loading