diff options
Diffstat (limited to 'llvm/tools/llvm-mca/BackendStatistics.h')
| -rw-r--r-- | llvm/tools/llvm-mca/BackendStatistics.h | 53 |
1 files changed, 4 insertions, 49 deletions
diff --git a/llvm/tools/llvm-mca/BackendStatistics.h b/llvm/tools/llvm-mca/BackendStatistics.h index 29fd43eb2c5..24b8e5c565b 100644 --- a/llvm/tools/llvm-mca/BackendStatistics.h +++ b/llvm/tools/llvm-mca/BackendStatistics.h @@ -8,18 +8,12 @@ //===----------------------------------------------------------------------===// /// \file /// -/// This file implements a printer class for printing generic Backend -/// statistics related to the scheduler and retire unit. +/// This file implements a View named BackendStatistics that knows how to +/// collect and print a few statistics related to the retire unit. /// /// Example: /// ======== /// -/// Schedulers - number of cycles where we saw N instructions issued: -/// [# issued], [# cycles] -/// 0, 7 (5.4%) -/// 1, 4 (3.1%) -/// 2, 8 (6.2%) -/// /// Retire Control Unit - number of cycles where we saw N instructions retired: /// [# retired], [# cycles] /// 0, 9 (6.9%) @@ -27,11 +21,6 @@ /// 2, 1 (0.8%) /// 4, 3 (2.3%) /// -/// Scheduler's queue usage: -/// JALU01, 0/20 -/// JFPU01, 18/18 -/// JLSAGU, 0/12 -/// //===----------------------------------------------------------------------===// #ifndef LLVM_TOOLS_LLVM_MCA_BACKENDSTATISTICS_H @@ -49,43 +38,21 @@ class BackendStatistics : public View { using Histogram = llvm::DenseMap<unsigned, unsigned>; Histogram RetiredPerCycle; - Histogram IssuedPerCycle; - unsigned NumIssued; unsigned NumRetired; unsigned NumCycles; - // Tracks the usage of a scheduler's queue. - struct BufferUsage { - unsigned SlotsInUse; - unsigned MaxUsedSlots; - }; - - // There is a map entry for each buffered resource in the scheduling model. - // Every time a buffer is consumed/freed, this view updates the corresponding - // entry. - llvm::DenseMap<unsigned, BufferUsage> BufferedResources; - void updateHistograms() { - IssuedPerCycle[NumIssued]++; RetiredPerCycle[NumRetired]++; - NumIssued = 0; NumRetired = 0; } - void printRetireUnitStatistics(llvm::raw_ostream &OS) const; - void printSchedulerStatistics(llvm::raw_ostream &OS) const; - void printRCUStatistics(llvm::raw_ostream &OS, const Histogram &Histogram, unsigned Cycles) const; - void printIssuePerCycle(const Histogram &IssuePerCycle, - unsigned TotalCycles) const; - void printSchedulerUsage(llvm::raw_ostream &OS, - const llvm::MCSchedModel &SM) const; public: BackendStatistics(const llvm::MCSubtargetInfo &sti) - : STI(sti), NumIssued(0), NumRetired(0), NumCycles(0) { } + : STI(sti), NumRetired(0), NumCycles(0) {} void onInstructionEvent(const HWInstructionEvent &Event) override; @@ -93,19 +60,7 @@ public: void onCycleEnd(unsigned Cycle) override { updateHistograms(); } - // Increases the number of used scheduler queue slots of every buffered - // resource in the Buffers set. - void onReservedBuffers(llvm::ArrayRef<unsigned> Buffers) override; - - // Decreases by one the number of used scheduler queue slots of every - // buffered resource in the Buffers set. - void onReleasedBuffers(llvm::ArrayRef<unsigned> Buffers) override; - - void printView(llvm::raw_ostream &OS) const override { - printSchedulerStatistics(OS); - printRetireUnitStatistics(OS); - printSchedulerUsage(OS, STI.getSchedModel()); - } + void printView(llvm::raw_ostream &OS) const override; }; } // namespace mca |

