summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Scheduler.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca/Scheduler.h')
-rw-r--r--llvm/tools/llvm-mca/Scheduler.h38
1 files changed, 5 insertions, 33 deletions
diff --git a/llvm/tools/llvm-mca/Scheduler.h b/llvm/tools/llvm-mca/Scheduler.h
index ad73fc7979c..9f9422c3f1a 100644
--- a/llvm/tools/llvm-mca/Scheduler.h
+++ b/llvm/tools/llvm-mca/Scheduler.h
@@ -454,42 +454,14 @@ public:
void setDispatchUnit(DispatchUnit *DispUnit) { DU = DispUnit; }
- /// Scheduling events.
+ /// Check if instruction at index Idx can be dispatched.
///
/// The DispatchUnit is responsible for querying the Scheduler before
/// dispatching new instructions. Queries are performed through method
- /// `Scheduler::CanBeDispatched`, which returns an instance of this enum to
- /// tell if the dispatch would fail or not. If scheduling resources are
- /// available, and the instruction can be dispatched, then the query returns
- /// HWS_AVAILABLE. A values different than HWS_AVAILABLE means that the
- /// instruction cannot be dispatched during this cycle.
- ///
- /// Each event name starts with prefix "HWS_", and it is followed by
- /// a substring which describes the reason why the Scheduler was unavailable
- /// (or "AVAILABLE" if the instruction is allowed to be dispatched).
- ///
- /// HWS_QUEUE_UNAVAILABLE is returned if there are not enough available slots
- /// in the scheduler's queue. That means, one (or more) buffered resources
- /// consumed by the instruction were full.
- ///
- /// HWS_LD_QUEUE_UNAVAILABLE is returned when an instruction 'mayLoad', and
- /// the load queue in the load/store unit (implemented by class LSUnit) is
- /// full. Similarly, HWS_ST_QUEUE_UNAVAILABLE is returned when the store
- /// queue is full, and the instruction to be dispatched 'mayStore'.
- ///
- /// HWS_DISPATCH_GROUP_RESTRICTION is only returned in special cases where the
- /// instruction consumes an in-order issue/dispatch resource (i.e. a resource
- /// with `BufferSize=0`), and the pipeline resource is not immediately
- /// available.
- enum Event {
- HWS_AVAILABLE,
- HWS_QUEUE_UNAVAILABLE,
- HWS_DISPATCH_GROUP_RESTRICTION,
- HWS_LD_QUEUE_UNAVAILABLE,
- HWS_ST_QUEUE_UNAVAILABLE
- };
-
- Event canBeDispatched(const InstrDesc &Desc) const;
+ /// `Scheduler::CanBeDispatched`. If scheduling resources are available,
+ /// and the instruction can be dispatched, then this method returns true.
+ /// Otherwise, a generic HWStallEvent is notified to the listeners.
+ bool canBeDispatched(unsigned Idx, const InstrDesc &Desc) const;
void scheduleInstruction(unsigned Idx, Instruction &MCIS);
void cycleEvent(unsigned Cycle);
OpenPOWER on IntegriCloud