[llvm-mca] Let the Scheduler notify dispatch stall events caused by the lack of scheduling resources.
This patch moves part of the logic that notifies dispatch stall events from the
DispatchUnit to the Scheduler.
The main goal of this patch is to remove (yet another) dependency between the
DispatchUnit and the Scheduler. Before this patch, the DispatchUnit had to know
about `Scheduler::Event` and how to classify stalls due to the lack of scheduling
resources. This patch removes that knowledge and simplifies the logic in
DispatchUnit::checkScheduler.
This is another change done in preparation for the work to fix PR36663.
No functional change intended.
llvm-svn: 329835
diff --git a/llvm/tools/llvm-mca/Dispatch.cpp b/llvm/tools/llvm-mca/Dispatch.cpp
index ce329b4..d3efe69 100644
--- a/llvm/tools/llvm-mca/Dispatch.cpp
+++ b/llvm/tools/llvm-mca/Dispatch.cpp
@@ -362,27 +362,7 @@
}
bool DispatchUnit::checkScheduler(unsigned Index, const InstrDesc &Desc) {
- // If this is a zero-latency instruction, then it bypasses
- // the scheduler.
- HWStallEvent::GenericEventType Type = HWStallEvent::Invalid;
- switch (SC->canBeDispatched(Desc)) {
- case Scheduler::HWS_AVAILABLE:
- return true;
- case Scheduler::HWS_QUEUE_UNAVAILABLE:
- Type = HWStallEvent::SchedulerQueueFull;
- break;
- case Scheduler::HWS_LD_QUEUE_UNAVAILABLE:
- Type = HWStallEvent::LoadQueueFull;
- break;
- case Scheduler::HWS_ST_QUEUE_UNAVAILABLE:
- Type = HWStallEvent::StoreQueueFull;
- break;
- case Scheduler::HWS_DISPATCH_GROUP_RESTRICTION:
- Type = HWStallEvent::DispatchGroupStall;
- }
-
- Owner->notifyStallEvent(HWStallEvent(Type, Index));
- return false;
+ return SC->canBeDispatched(Index, Desc);
}
void DispatchUnit::updateRAWDependencies(ReadState &RS,