1 //===--------------------- RetireControlUnitStatistics.h --------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
10 /// This file defines class RetireControlUnitStatistics: a view that knows how
11 /// to print general statistics related to the retire control unit.
16 /// Retire Control Unit - number of cycles where we saw N instructions retired:
17 /// [# retired], [# cycles]
22 /// Total ROB Entries: 64
23 /// Max Used ROB Entries: 35 ( 54.7% )
24 /// Average Used ROB Entries per cy: 32 ( 50.0% )
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"
38 class RetireControlUnitStatistics : public View {
39 using Histogram = std::map<unsigned, unsigned>;
40 Histogram RetiredPerCycle;
44 unsigned TotalROBEntries;
45 unsigned EntriesInUse;
46 unsigned MaxUsedEntries;
47 unsigned SumOfUsedEntries;
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;