[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/BackendStatistics.h b/llvm/tools/llvm-mca/BackendStatistics.h
index c3cec95..7de38b4 100644
--- a/llvm/tools/llvm-mca/BackendStatistics.h
+++ b/llvm/tools/llvm-mca/BackendStatistics.h
@@ -23,11 +23,6 @@
/// GROUP - Static restrictions on the dispatch group: 0
///
///
-/// Register Alias Table:
-/// Total number of mappings created: 210
-/// Max number of mappings used: 35
-///
-///
/// Dispatch Logic - number of cycles where we saw N instructions dispatched:
/// [# dispatched], [# cycles]
/// 0, 15 (11.5%)
@@ -61,7 +56,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/MC/MCSubtargetInfo.h"
-#include "llvm/Support/raw_ostream.h"
namespace mca {
@@ -102,24 +96,11 @@
NumRetired = 0;
}
- // Used to track the number of physical registers used in a register file.
- struct RegisterFileUsage {
- unsigned TotalMappings;
- unsigned MaxUsedMappings;
- unsigned CurrentlyUsedMappings;
- };
-
- // There is one entry for each register file implemented by the processor.
- llvm::SmallVector<RegisterFileUsage, 4> RegisterFiles;
-
- void initializeRegisterFileInfo();
-
void printRetireUnitStatistics(llvm::raw_ostream &OS) const;
void printDispatchUnitStatistics(llvm::raw_ostream &OS) const;
void printSchedulerStatistics(llvm::raw_ostream &OS) const;
void printDispatchStalls(llvm::raw_ostream &OS) const;
- void printRATStatistics(llvm::raw_ostream &OS) const;
void printRCUStatistics(llvm::raw_ostream &OS, const Histogram &Histogram,
unsigned Cycles) const;
void printDispatchUnitUsage(llvm::raw_ostream &OS, const Histogram &Stats,
@@ -132,9 +113,7 @@
public:
BackendStatistics(const llvm::MCSubtargetInfo &sti)
: STI(sti), NumDispatched(0), NumIssued(0), NumRetired(0), NumCycles(0),
- HWStalls(HWStallEvent::LastGenericEvent) {
- initializeRegisterFileInfo();
- }
+ HWStalls(HWStallEvent::LastGenericEvent) { }
void onInstructionEvent(const HWInstructionEvent &Event) override;
@@ -157,7 +136,6 @@
void printView(llvm::raw_ostream &OS) const override {
printDispatchStalls(OS);
- printRATStatistics(OS);
printDispatchUnitStatistics(OS);
printSchedulerStatistics(OS);
printRetireUnitStatistics(OS);