}
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() {}
printBottleneckHints(TempStream);
TempStream.flush();
OS << Buffer;
- LLVM_DEBUG(DG.dump(OS, MCIP));
}
} // namespace mca.
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);
/// 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;
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
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(