[llvm-mca] Move the logic that prints register file statistics to its own view. NFCI

Before this patch, the "BackendStatistics" view was responsible for printing the
register file usage (as well as many other statistics).

Now users can enable register file usage statistics using the command line flag
`-register-file-stats`. By default, the tool doesn't print register file
statistics.

llvm-svn: 329083
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 49d5047..7ad31df 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -25,6 +25,7 @@
 #include "BackendStatistics.h"
 #include "InstructionInfoView.h"
 #include "InstructionTables.h"
+#include "RegisterFileStatistics.h"
 #include "ResourcePressureView.h"
 #include "SummaryView.h"
 #include "TimelineView.h"
@@ -92,6 +93,11 @@
                      cl::init(0));
 
 static cl::opt<bool>
+    PrintRegisterFileStats("register-file-stats",
+                           cl::desc("Print register file statistics"),
+                           cl::init(false));
+
+static cl::opt<bool>
     PrintResourcePressureView("resource-pressure",
                               cl::desc("Print the resource pressure view"),
                               cl::init(true));
@@ -370,6 +376,9 @@
   if (PrintModeVerbose)
     Printer->addView(llvm::make_unique<mca::BackendStatistics>(*STI));
 
+  if (PrintRegisterFileStats)
+    Printer->addView(llvm::make_unique<mca::RegisterFileStatistics>(*STI));
+
   if (PrintResourcePressureView)
     Printer->addView(
         llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, *S));