summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca')
-rw-r--r--llvm/tools/llvm-mca/Backend.h3
-rw-r--r--llvm/tools/llvm-mca/BackendStatistics.h9
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/llvm/tools/llvm-mca/Backend.h b/llvm/tools/llvm-mca/Backend.h
index 13e65bb208d..77f0524960f 100644
--- a/llvm/tools/llvm-mca/Backend.h
+++ b/llvm/tools/llvm-mca/Backend.h
@@ -93,9 +93,6 @@ public:
unsigned getMaxUsedRegisterMappings() const {
return DU->getMaxUsedRegisterMappings();
}
- const llvm::MCSchedModel &getSchedModel() const {
- return STI.getSchedModel();
- }
void getBuffersUsage(std::vector<BufferUsageEntry> &Usage) const {
return HWS->getBuffersUsage(Usage);
}
diff --git a/llvm/tools/llvm-mca/BackendStatistics.h b/llvm/tools/llvm-mca/BackendStatistics.h
index b38ae451657..28c3e0de136 100644
--- a/llvm/tools/llvm-mca/BackendStatistics.h
+++ b/llvm/tools/llvm-mca/BackendStatistics.h
@@ -59,6 +59,7 @@
#include "Backend.h"
#include "View.h"
+#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
@@ -67,6 +68,7 @@ namespace mca {
class BackendStatistics : public View {
// TODO: remove the dependency from Backend.
const Backend &B;
+ const llvm::MCSubtargetInfo &STI;
using Histogram = std::map<unsigned, unsigned>;
Histogram DispatchGroupSizePerCycle;
@@ -107,8 +109,9 @@ class BackendStatistics : public View {
const llvm::ArrayRef<BufferUsageEntry> &Usage) const;
public:
- BackendStatistics(const Backend &backend)
- : B(backend), NumDispatched(0), NumIssued(0), NumRetired(0), NumCycles(0) {}
+ BackendStatistics(const Backend &backend, const llvm::MCSubtargetInfo &sti)
+ : B(backend), STI(sti), NumDispatched(0), NumIssued(0), NumRetired(0),
+ NumCycles(0) {}
void onInstructionEvent(const HWInstructionEvent &Event) override;
@@ -128,7 +131,7 @@ public:
std::vector<BufferUsageEntry> Usage;
B.getBuffersUsage(Usage);
- printSchedulerUsage(OS, B.getSchedModel(), Usage);
+ printSchedulerUsage(OS, STI.getSchedModel(), Usage);
}
};
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 8acfd46b1f0..baba4056061 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -330,7 +330,7 @@ int main(int argc, char **argv) {
if (PrintModeVerbose) {
std::unique_ptr<mca::BackendStatistics> BS =
- llvm::make_unique<mca::BackendStatistics>(*B);
+ llvm::make_unique<mca::BackendStatistics>(*B, *STI);
Printer->addView(std::move(BS));
}
OpenPOWER on IntegriCloud