summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca/Pipeline.cpp')
-rw-r--r--llvm/tools/llvm-mca/Pipeline.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/tools/llvm-mca/Pipeline.cpp b/llvm/tools/llvm-mca/Pipeline.cpp
index ebaacb27a9f..eb95b0c496f 100644
--- a/llvm/tools/llvm-mca/Pipeline.cpp
+++ b/llvm/tools/llvm-mca/Pipeline.cpp
@@ -58,13 +58,15 @@ void Pipeline::postExecuteStages(const InstRef &IR) {
}
void Pipeline::run() {
- while (hasWorkToProcess())
- runCycle(Cycles++);
+ while (hasWorkToProcess()) {
+ notifyCycleBegin();
+ runCycle();
+ notifyCycleEnd();
+ ++Cycles;
+ }
}
-void Pipeline::runCycle(unsigned Cycle) {
- notifyCycleBegin(Cycle);
-
+void Pipeline::runCycle() {
// Update the stages before we do any processing for this cycle.
InstRef IR;
for (auto &S : Stages)
@@ -81,18 +83,16 @@ void Pipeline::runCycle(unsigned Cycle) {
for (auto &S : Stages)
S->cycleEnd();
-
- notifyCycleEnd(Cycle);
}
-void Pipeline::notifyCycleBegin(unsigned Cycle) {
- LLVM_DEBUG(dbgs() << "[E] Cycle begin: " << Cycle << '\n');
+void Pipeline::notifyCycleBegin() {
+ LLVM_DEBUG(dbgs() << "[E] Cycle begin: " << Cycles << '\n');
for (HWEventListener *Listener : Listeners)
Listener->onCycleBegin();
}
-void Pipeline::notifyCycleEnd(unsigned Cycle) {
- LLVM_DEBUG(dbgs() << "[E] Cycle end: " << Cycle << "\n\n");
+void Pipeline::notifyCycleEnd() {
+ LLVM_DEBUG(dbgs() << "[E] Cycle end: " << Cycles << "\n\n");
for (HWEventListener *Listener : Listeners)
Listener->onCycleEnd();
}
OpenPOWER on IntegriCloud