[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / tools / llvm-mca / Views / RetireControlUnitStatistics.h
blob1a4d3dec5c56f1ac566d95ad39061fbb8ea6bad5
1 //===--------------------- RetireControlUnitStatistics.h --------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 ///
10 /// This file defines class RetireControlUnitStatistics: a view that knows how
11 /// to print general statistics related to the retire control unit.
12 ///
13 /// Example:
14 /// ========
15 ///
16 /// Retire Control Unit - number of cycles where we saw N instructions retired:
17 /// [# retired], [# cycles]
18 /// 0, 109 (17.9%)
19 /// 1, 102 (16.7%)
20 /// 2, 399 (65.4%)
21 ///
22 /// Total ROB Entries: 64
23 /// Max Used ROB Entries: 35 ( 54.7% )
24 /// Average Used ROB Entries per cy: 32 ( 50.0% )
25 ///
26 //===----------------------------------------------------------------------===//
28 #ifndef LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H
29 #define LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H
31 #include "Views/View.h"
32 #include "llvm/MC/MCSchedule.h"
33 #include <map>
35 namespace llvm {
36 namespace mca {
38 class RetireControlUnitStatistics : public View {
39 using Histogram = std::map<unsigned, unsigned>;
40 Histogram RetiredPerCycle;
42 unsigned NumRetired;
43 unsigned NumCycles;
44 unsigned TotalROBEntries;
45 unsigned EntriesInUse;
46 unsigned MaxUsedEntries;
47 unsigned SumOfUsedEntries;
49 public:
50 RetireControlUnitStatistics(const MCSchedModel &SM);
52 void onEvent(const HWInstructionEvent &Event) override;
53 void onCycleEnd() override;
54 void printView(llvm::raw_ostream &OS) const override;
57 } // namespace mca
58 } // namespace llvm
60 #endif