summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Views/SummaryView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca/Views/SummaryView.cpp')
-rw-r--r--llvm/tools/llvm-mca/Views/SummaryView.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/llvm-mca/Views/SummaryView.cpp b/llvm/tools/llvm-mca/Views/SummaryView.cpp
index 44b1139c94f..e3d85507dc8 100644
--- a/llvm/tools/llvm-mca/Views/SummaryView.cpp
+++ b/llvm/tools/llvm-mca/Views/SummaryView.cpp
@@ -23,7 +23,7 @@ namespace mca {
#define DEBUG_TYPE "llvm-mca"
SummaryView::SummaryView(const MCSchedModel &Model, ArrayRef<MCInst> S,
- unsigned Width)
+ unsigned Width, bool EmitBottleneckAnalysis)
: SM(Model), Source(S), DispatchWidth(Width), LastInstructionIdx(0),
TotalCycles(0), NumMicroOps(0), BPI({0, 0, 0, 0, 0}),
ResourcePressureDistribution(Model.getNumProcResourceKinds(), 0),
@@ -32,7 +32,8 @@ SummaryView::SummaryView(const MCSchedModel &Model, ArrayRef<MCInst> S,
ResIdx2ProcResID(Model.getNumProcResourceKinds(), 0),
PressureIncreasedBecauseOfResources(false),
PressureIncreasedBecauseOfDataDependencies(false),
- SeenStallCycles(false) {
+ SeenStallCycles(false),
+ ShouldEmitBottleneckAnalysis(EmitBottleneckAnalysis) {
computeProcResourceMasks(SM, ProcResourceMasks);
for (unsigned I = 1, E = SM.getNumProcResourceKinds(); I < E; ++I) {
unsigned Index = getResourceStateIndex(ProcResourceMasks[I]);
@@ -111,8 +112,10 @@ void SummaryView::onEvent(const HWPressureEvent &Event) {
}
void SummaryView::printBottleneckHints(raw_ostream &OS) const {
- if (!SeenStallCycles || !BPI.PressureIncreaseCycles)
+ if (!SeenStallCycles || !BPI.PressureIncreaseCycles) {
+ OS << "\nNo resource or data dependency bottlenecks discovered.\n";
return;
+ }
double PressurePerCycle =
(double)BPI.PressureIncreaseCycles * 100 / TotalCycles;
@@ -181,8 +184,8 @@ void SummaryView::printView(raw_ostream &OS) const {
TempStream << "\nBlock RThroughput: "
<< format("%.1f", floor((BlockRThroughput * 10) + 0.5) / 10)
<< '\n';
-
- printBottleneckHints(TempStream);
+ if (ShouldEmitBottleneckAnalysis)
+ printBottleneckHints(TempStream);
TempStream.flush();
OS << Buffer;
}
OpenPOWER on IntegriCloud