diff options
Diffstat (limited to 'llvm/tools/llvm-mca')
-rw-r--r-- | llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp | 11 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/Views/BottleneckAnalysis.h | 13 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/llvm-mca.cpp | 3 |
3 files changed, 12 insertions, 15 deletions
diff --git a/llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp b/llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp index ea2cb71bae7..cde896fbb5f 100644 --- a/llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp +++ b/llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp @@ -205,12 +205,10 @@ void DependencyGraph::addDepImpl(SmallVectorImpl<DependencyEdge> &Vec, } BottleneckAnalysis::BottleneckAnalysis(const MCSubtargetInfo &sti, - MCInstPrinter &Printer, - ArrayRef<MCInst> Sequence, - unsigned Executions) - : STI(sti), MCIP(Printer), Tracker(STI.getSchedModel()), - DG(Sequence.size()), Source(Sequence), Iterations(Executions), - TotalCycles(0), PressureIncreasedBecauseOfResources(false), + ArrayRef<MCInst> Sequence) + : STI(sti), Tracker(STI.getSchedModel()), DG(Sequence.size()), + Source(Sequence), TotalCycles(0), + PressureIncreasedBecauseOfResources(false), PressureIncreasedBecauseOfRegisterDependencies(false), PressureIncreasedBecauseOfMemoryDependencies(false), SeenStallCycles(false), BPI() {} @@ -356,7 +354,6 @@ void BottleneckAnalysis::printView(raw_ostream &OS) const { printBottleneckHints(TempStream); TempStream.flush(); OS << Buffer; - LLVM_DEBUG(DG.dump(OS, MCIP)); } } // namespace mca. diff --git a/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h b/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h index c9f4865e960..4c4dc193e13 100644 --- a/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h +++ b/llvm/tools/llvm-mca/Views/BottleneckAnalysis.h @@ -149,7 +149,7 @@ public: void dumpMemDeps(raw_ostream &OS) const; void dumpResDeps(raw_ostream &OS) const; - void dump(raw_ostream &OS, llvm::MCInstPrinter &MCIP) const { + void dump(raw_ostream &OS, MCInstPrinter &MCIP) const { dumpRegDeps(OS, MCIP); dumpMemDeps(OS); dumpResDeps(OS); @@ -160,12 +160,10 @@ public: /// A view that collects and prints a few performance numbers. class BottleneckAnalysis : public View { const MCSubtargetInfo &STI; - MCInstPrinter &MCIP; PressureTracker Tracker; DependencyGraph DG; ArrayRef<MCInst> Source; - unsigned Iterations; unsigned TotalCycles; bool PressureIncreasedBecauseOfResources; @@ -192,15 +190,18 @@ class BottleneckAnalysis : public View { void printBottleneckHints(raw_ostream &OS) const; public: - BottleneckAnalysis(const MCSubtargetInfo &STI, MCInstPrinter &MCIP, - ArrayRef<MCInst> Sequence, unsigned Iterations); + BottleneckAnalysis(const MCSubtargetInfo &STI, ArrayRef<MCInst> Sequence); void onCycleEnd() override; void onEvent(const HWStallEvent &Event) override { SeenStallCycles = true; } void onEvent(const HWPressureEvent &Event) override; void onEvent(const HWInstructionEvent &Event) override; - void printView(llvm::raw_ostream &OS) const override; + void printView(raw_ostream &OS) const override; + +#ifndef NDEBUG + void dump(raw_ostream &OS, MCInstPrinter &MCIP) const { DG.dump(OS, MCIP); } +#endif }; } // namespace mca diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index 75886a6b31b..a875c70e17f 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -487,8 +487,7 @@ int main(int argc, char **argv) { llvm::make_unique<mca::SummaryView>(SM, Insts, DispatchWidth)); if (EnableBottleneckAnalysis) - Printer.addView(llvm::make_unique<mca::BottleneckAnalysis>( - *STI, *IP, Insts, S.getNumIterations())); + Printer.addView(llvm::make_unique<mca::BottleneckAnalysis>(*STI, Insts)); if (PrintInstructionInfoView) Printer.addView( |