[llvm] r327756 - [llvm-mca] Remove method getSchedModel() from the Backend.
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 16 15:21:52 PDT 2018
Author: adibiagio
Date: Fri Mar 16 15:21:52 2018
New Revision: 327756
URL: http://llvm.org/viewvc/llvm-project?rev=327756&view=rev
Log:
[llvm-mca] Remove method getSchedModel() from the Backend.
Modified:
llvm/trunk/tools/llvm-mca/Backend.h
llvm/trunk/tools/llvm-mca/BackendStatistics.h
llvm/trunk/tools/llvm-mca/llvm-mca.cpp
Modified: llvm/trunk/tools/llvm-mca/Backend.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/Backend.h?rev=327756&r1=327755&r2=327756&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/Backend.h (original)
+++ llvm/trunk/tools/llvm-mca/Backend.h Fri Mar 16 15:21:52 2018
@@ -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);
}
Modified: llvm/trunk/tools/llvm-mca/BackendStatistics.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/BackendStatistics.h?rev=327756&r1=327755&r2=327756&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/BackendStatistics.h (original)
+++ llvm/trunk/tools/llvm-mca/BackendStatistics.h Fri Mar 16 15:21:52 2018
@@ -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);
}
};
Modified: llvm/trunk/tools/llvm-mca/llvm-mca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/llvm-mca.cpp?rev=327756&r1=327755&r2=327756&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/llvm-mca.cpp (original)
+++ llvm/trunk/tools/llvm-mca/llvm-mca.cpp Fri Mar 16 15:21:52 2018
@@ -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));
}
More information about the llvm-commits
mailing list