diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-04-11 12:12:53 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-04-11 12:12:53 +0000 |
commit | f41ad5c59efd7a11d78b9742228dcf858bd33d84 (patch) | |
tree | 9f4dfcdc009eb0a9551d1999eb5f0b311faf1546 /llvm/tools | |
parent | 1cc29c045e07dd2f9adda3a5569df6e249613135 (diff) | |
download | bcm5719-llvm-f41ad5c59efd7a11d78b9742228dcf858bd33d84.tar.gz bcm5719-llvm-f41ad5c59efd7a11d78b9742228dcf858bd33d84.zip |
[llvm-mca] Renamed BackendStatistics to RetireControlUnitStatistics.
Also, removed flag -verbose in favor of flag -retire-stats.
llvm-svn: 329794
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-mca/CMakeLists.txt | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/RetireControlUnitStatistics.cpp (renamed from llvm/tools/llvm-mca/BackendStatistics.cpp) | 13 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/RetireControlUnitStatistics.h (renamed from llvm/tools/llvm-mca/BackendStatistics.h) | 22 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/llvm-mca.cpp | 15 |
4 files changed, 26 insertions, 26 deletions
diff --git a/llvm/tools/llvm-mca/CMakeLists.txt b/llvm/tools/llvm-mca/CMakeLists.txt index e0a97a5d4d8..20a9966cedf 100644 --- a/llvm/tools/llvm-mca/CMakeLists.txt +++ b/llvm/tools/llvm-mca/CMakeLists.txt @@ -12,7 +12,6 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(llvm-mca Backend.cpp BackendPrinter.cpp - BackendStatistics.cpp CodeRegion.cpp Dispatch.cpp DispatchStatistics.cpp @@ -25,6 +24,7 @@ add_llvm_tool(llvm-mca llvm-mca.cpp RegisterFileStatistics.cpp ResourcePressureView.cpp + RetireControlUnitStatistics.cpp Scheduler.cpp SchedulerStatistics.cpp Support.cpp diff --git a/llvm/tools/llvm-mca/BackendStatistics.cpp b/llvm/tools/llvm-mca/RetireControlUnitStatistics.cpp index 4e378b16beb..5b1a1ded170 100644 --- a/llvm/tools/llvm-mca/BackendStatistics.cpp +++ b/llvm/tools/llvm-mca/RetireControlUnitStatistics.cpp @@ -1,4 +1,5 @@ -//===--------------------- BackendStatistics.cpp ---------------*- C++ -*-===// +//===--------------------- RetireControlUnitStatistics.cpp ---------------*- C++ +//-*-===// // // The LLVM Compiler Infrastructure // @@ -8,24 +9,24 @@ //===----------------------------------------------------------------------===// /// \file /// -/// Functionalities used by the BackendPrinter to print out histograms -/// related to number of {issue/retire} per number of cycles. +/// This file implements the RetireControlUnitStatistics interface. /// //===----------------------------------------------------------------------===// -#include "BackendStatistics.h" +#include "RetireControlUnitStatistics.h" #include "llvm/Support/Format.h" using namespace llvm; namespace mca { -void BackendStatistics::onInstructionEvent(const HWInstructionEvent &Event) { +void RetireControlUnitStatistics::onInstructionEvent( + const HWInstructionEvent &Event) { if (Event.Type == HWInstructionEvent::Retired) ++NumRetired; } -void BackendStatistics::printView(llvm::raw_ostream &OS) const { +void RetireControlUnitStatistics::printView(llvm::raw_ostream &OS) const { std::string Buffer; raw_string_ostream TempStream(Buffer); TempStream << "\n\nRetire Control Unit - " diff --git a/llvm/tools/llvm-mca/BackendStatistics.h b/llvm/tools/llvm-mca/RetireControlUnitStatistics.h index 24b8e5c565b..f3952abe11d 100644 --- a/llvm/tools/llvm-mca/BackendStatistics.h +++ b/llvm/tools/llvm-mca/RetireControlUnitStatistics.h @@ -1,4 +1,5 @@ -//===--------------------- BackendStatistics.h ------------------*- C++ -*-===// +//===--------------------- RetireControlUnitStatistics.h ------------------*- +//C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -8,8 +9,8 @@ //===----------------------------------------------------------------------===// /// \file /// -/// This file implements a View named BackendStatistics that knows how to -/// collect and print a few statistics related to the retire unit. +/// This file defines class RetireControlUnitStatistics: a view that knows how +/// to print general statistics related to the retire control unit. /// /// Example: /// ======== @@ -23,19 +24,16 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_BACKENDSTATISTICS_H -#define LLVM_TOOLS_LLVM_MCA_BACKENDSTATISTICS_H +#ifndef LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H +#define LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H #include "View.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/MC/MCSubtargetInfo.h" namespace mca { -class BackendStatistics : public View { - const llvm::MCSubtargetInfo &STI; - +class RetireControlUnitStatistics : public View { using Histogram = llvm::DenseMap<unsigned, unsigned>; Histogram RetiredPerCycle; @@ -47,12 +45,8 @@ class BackendStatistics : public View { NumRetired = 0; } - void printRCUStatistics(llvm::raw_ostream &OS, const Histogram &Histogram, - unsigned Cycles) const; - public: - BackendStatistics(const llvm::MCSubtargetInfo &sti) - : STI(sti), NumRetired(0), NumCycles(0) {} + RetireControlUnitStatistics() : NumRetired(0), NumCycles(0) {} void onInstructionEvent(const HWInstructionEvent &Event) override; diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index 7b50196f418..3cb62928349 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -22,13 +22,13 @@ //===----------------------------------------------------------------------===// #include "BackendPrinter.h" -#include "BackendStatistics.h" #include "CodeRegion.h" #include "DispatchStatistics.h" #include "InstructionInfoView.h" #include "InstructionTables.h" #include "RegisterFileStatistics.h" #include "ResourcePressureView.h" +#include "RetireControlUnitStatistics.h" #include "SchedulerStatistics.h" #include "SummaryView.h" #include "TimelineView.h" @@ -101,11 +101,16 @@ static cl::opt<bool> cl::init(false)); static cl::opt<bool> - PrintiSchedulerStats("scheduler-stats", + PrintSchedulerStats("scheduler-stats", cl::desc("Print scheduler statistics"), cl::init(false)); static cl::opt<bool> + PrintRetireStats("retire-stats", + cl::desc("Print retire control unit statistics"), + cl::init(false)); + +static cl::opt<bool> PrintResourcePressureView("resource-pressure", cl::desc("Print the resource pressure view"), cl::init(true)); @@ -438,11 +443,11 @@ int main(int argc, char **argv) { if (PrintDispatchStats) Printer.addView(llvm::make_unique<mca::DispatchStatistics>(*STI)); - if (PrintiSchedulerStats) + if (PrintSchedulerStats) Printer.addView(llvm::make_unique<mca::SchedulerStatistics>(*STI)); - if (PrintModeVerbose) - Printer.addView(llvm::make_unique<mca::BackendStatistics>(*STI)); + if (PrintRetireStats) + Printer.addView(llvm::make_unique<mca::RetireControlUnitStatistics>()); if (PrintRegisterFileStats) Printer.addView(llvm::make_unique<mca::RegisterFileStatistics>(*STI)); |