diff options
author | Clement Courbet <courbet@google.com> | 2018-03-13 13:11:01 +0000 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2018-03-13 13:11:01 +0000 |
commit | 844f22d3c3806f372c1bec258a4bc559f974081d (patch) | |
tree | ba6ab90f820ffd1d69f46206e07e9e9f49322d76 /llvm/tools/llvm-mca/Scheduler.h | |
parent | 9d7e9032f1bd3a7cd83ed1883069bcced7b52b21 (diff) | |
download | bcm5719-llvm-844f22d3c3806f372c1bec258a4bc559f974081d.tar.gz bcm5719-llvm-844f22d3c3806f372c1bec258a4bc559f974081d.zip |
[llvm-mca] Refactor event listeners to make the backend agnostic to event types.
Summary: This is a first step towards making the pipeline configurable.
Subscribers: llvm-commits, andreadb
Differential Revision: https://reviews.llvm.org/D44309
llvm-svn: 327389
Diffstat (limited to 'llvm/tools/llvm-mca/Scheduler.h')
-rw-r--r-- | llvm/tools/llvm-mca/Scheduler.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mca/Scheduler.h b/llvm/tools/llvm-mca/Scheduler.h index 7bc28739746..81daaa72c15 100644 --- a/llvm/tools/llvm-mca/Scheduler.h +++ b/llvm/tools/llvm-mca/Scheduler.h @@ -24,6 +24,8 @@ namespace mca { class Backend; +class DispatchUnit; + /// Used to notify the internal state of a processor resource. /// /// A processor resource is available if it is not reserved, and there are @@ -455,7 +457,10 @@ class Scheduler { std::unique_ptr<LSUnit> LSU; // The Backend gets notified when instructions are ready/issued/executed. - Backend *Owner; + Backend *const Owner; + + // The dispatch unit gets notified when instructions are executed. + DispatchUnit *DU; using QueueEntryTy = std::pair<unsigned, Instruction *>; std::map<unsigned, Instruction *> WaitQueue; @@ -486,6 +491,8 @@ public: AssumeNoAlias)), Owner(B) {} + void setDispatchUnit(DispatchUnit *DispUnit) { DU = DispUnit; } + /// Scheduling events. /// /// The DispatchUnit is responsible for querying the Scheduler before |