[llvm-mca] Remove the logic that computes the reciprocal throughput, and make the SummaryView independent from the Backend. NFCI
Since r327420, the tool can query the MCSchedModel interface to obtain the
reciprocal throughput information.
As a consequence, method `ResourceManager::getRThroughput`, and
method `Backend::getRThroughput` are no longer needed.
This patch simplifies the code by removing the custom RThroughput computation.
This patch also refactors class SummaryView by removing the dependency with
the Backend object.
No functional change intended.
llvm-svn: 327425
diff --git a/llvm/tools/llvm-mca/SummaryView.h b/llvm/tools/llvm-mca/SummaryView.h
index d42d60c..db2d4c4 100644
--- a/llvm/tools/llvm-mca/SummaryView.h
+++ b/llvm/tools/llvm-mca/SummaryView.h
@@ -49,9 +49,11 @@
#ifndef LLVM_TOOLS_LLVM_MCA_SUMMARYVIEW_H
#define LLVM_TOOLS_LLVM_MCA_SUMMARYVIEW_H
-#include "Backend.h"
+#include "SourceMgr.h"
#include "View.h"
#include "llvm/MC/MCInstPrinter.h"
+#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/MC/MCInstrInfo.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE "llvm-mca"
@@ -66,10 +68,11 @@
/// classes the task of printing out timeline information as well as
/// resource pressure.
class SummaryView : public View {
- const Backend &B;
+ const llvm::MCSubtargetInfo &STI;
+ const llvm::MCInstrInfo &MCII;
+ const SourceMgr &Source;
llvm::MCInstPrinter &MCIP;
- const unsigned Iterations;
- const unsigned Instructions;
+
const unsigned DispatchWidth;
unsigned TotalCycles;
@@ -77,10 +80,10 @@
void printInstructionInfo(llvm::raw_ostream &OS) const;
public:
- SummaryView(const Backend &backend, llvm::MCInstPrinter &IP,
- unsigned NumIterations, unsigned NumInstructions, unsigned Width)
- : B(backend), MCIP(IP), Iterations(NumIterations),
- Instructions(NumInstructions), DispatchWidth(Width), TotalCycles(0) {}
+ SummaryView(const llvm::MCSubtargetInfo &sti, const llvm::MCInstrInfo &mcii,
+ const SourceMgr &S, llvm::MCInstPrinter &IP, unsigned Width)
+ : STI(sti), MCII(mcii), Source(S), MCIP(IP), DispatchWidth(Width),
+ TotalCycles(0) {}
void onCycleEnd(unsigned /* unused */) override { ++TotalCycles; }