1 //===--------------------- RetireControlUnitStatistics.h --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// This file defines class RetireControlUnitStatistics: a view that knows how
12 /// to print general statistics related to the retire control unit.
17 /// Retire Control Unit - number of cycles where we saw N instructions retired:
18 /// [# retired], [# cycles]
23 /// Total ROB Entries: 64
24 /// Max Used ROB Entries: 35 ( 54.7% )
25 /// Average Used ROB Entries per cy: 32 ( 50.0% )
27 //===----------------------------------------------------------------------===//
29 #ifndef LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H
30 #define LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H
32 #include "Views/View.h"
33 #include "llvm/MC/MCSchedule.h"
39 class RetireControlUnitStatistics : public View {
40 using Histogram = std::map<unsigned, unsigned>;
41 Histogram RetiredPerCycle;
45 unsigned TotalROBEntries;
46 unsigned EntriesInUse;
47 unsigned MaxUsedEntries;
48 unsigned SumOfUsedEntries;
51 RetireControlUnitStatistics(const MCSchedModel &SM);
53 void onEvent(const HWInstructionEvent &Event) override;
54 void onCycleEnd() override;
55 void printView(llvm::raw_ostream &OS) const override;