[llvm-mca] Renamed BackendStatistics to RetireControlUnitStatistics.

Also, removed flag -verbose in favor of flag -retire-stats.

llvm-svn: 329794
diff --git a/llvm/tools/llvm-mca/CMakeLists.txt b/llvm/tools/llvm-mca/CMakeLists.txt
index e0a97a5..20a9966 100644
--- a/llvm/tools/llvm-mca/CMakeLists.txt
+++ b/llvm/tools/llvm-mca/CMakeLists.txt
@@ -12,7 +12,6 @@
 add_llvm_tool(llvm-mca
   Backend.cpp
   BackendPrinter.cpp
-  BackendStatistics.cpp
   CodeRegion.cpp
   Dispatch.cpp
   DispatchStatistics.cpp
@@ -25,6 +24,7 @@
   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
similarity index 74%
rename from llvm/tools/llvm-mca/BackendStatistics.cpp
rename to llvm/tools/llvm-mca/RetireControlUnitStatistics.cpp
index 4e378b1..5b1a1de 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
similarity index 65%
rename from llvm/tools/llvm-mca/BackendStatistics.h
rename to llvm/tools/llvm-mca/RetireControlUnitStatistics.h
index 24b8e5c..f3952ab 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 @@
     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 7b50196..3cb6292 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 @@
                        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 @@
     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));