[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / tools / llvm-mca / Views / RetireControlUnitStatistics.h
blobed3736c64515ef216cbfa7bf452d89b89385aaca
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 "llvm/MC/MCSchedule.h"
32 #include "llvm/MCA/View.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;
55 StringRef getNameAsString() const override {
56 return "RetireControlUnitStatistics";
58 bool isSerializable() const override { return false; }
61 } // namespace mca
62 } // namespace llvm
64 #endif