Index: llvm/trunk/tools/llvm-mca/TimelineView.h =================================================================== --- llvm/trunk/tools/llvm-mca/TimelineView.h +++ llvm/trunk/tools/llvm-mca/TimelineView.h @@ -152,6 +152,16 @@ void initialize(unsigned MaxIterations); + // Display characters for the TimelineView report output. + struct DisplayChar { + static const char Dispatched = 'D'; + static const char Executed = 'E'; + static const char Retired = 'R'; + static const char Waiting = '='; // Instruction is waiting in the scheduler. + static const char Executing = 'e'; + static const char RetireLag = '-'; // The instruction is waiting to retire. + }; + public: TimelineView(const llvm::MCSubtargetInfo &sti, llvm::MCInstPrinter &Printer, const SourceMgr &Sequence, unsigned MaxIterations, Index: llvm/trunk/tools/llvm-mca/TimelineView.cpp =================================================================== --- llvm/trunk/tools/llvm-mca/TimelineView.cpp +++ llvm/trunk/tools/llvm-mca/TimelineView.cpp @@ -153,28 +153,28 @@ OS << '[' << Iteration << ',' << SourceIndex << "]\t"; for (unsigned I = 0, E = Entry.CycleDispatched; I < E; ++I) OS << ((I % 5 == 0) ? '.' : ' '); - OS << 'D'; + OS << TimelineView::DisplayChar::Dispatched; if (Entry.CycleDispatched != Entry.CycleExecuted) { // Zero latency instructions have the same value for CycleDispatched, // CycleIssued and CycleExecuted. for (unsigned I = Entry.CycleDispatched + 1, E = Entry.CycleIssued; I < E; ++I) - OS << '='; + OS << TimelineView::DisplayChar::Waiting; if (Entry.CycleIssued == Entry.CycleExecuted) - OS << 'E'; + OS << TimelineView::DisplayChar::DisplayChar::Executed; else { if (Entry.CycleDispatched != Entry.CycleIssued) - OS << 'e'; + OS << TimelineView::DisplayChar::Executing; for (unsigned I = Entry.CycleIssued + 1, E = Entry.CycleExecuted; I < E; ++I) - OS << 'e'; - OS << 'E'; + OS << TimelineView::DisplayChar::Executing; + OS << TimelineView::DisplayChar::Executed; } } for (unsigned I = Entry.CycleExecuted + 1, E = Entry.CycleRetired; I < E; ++I) - OS << '-'; - OS << 'R'; + OS << TimelineView::DisplayChar::RetireLag; + OS << TimelineView::DisplayChar::Retired; // Skip other columns. for (unsigned I = Entry.CycleRetired + 1, E = LastCycle; I <= E; ++I)