diff --git a/lib/MCA/Stages/InOrderIssueStage.cpp b/lib/MCA/Stages/InOrderIssueStage.cpp index a5dad7cd28c..ccf6f20a673 100644 --- a/lib/MCA/Stages/InOrderIssueStage.cpp +++ b/lib/MCA/Stages/InOrderIssueStage.cpp @@ -241,6 +241,18 @@ llvm::Error InOrderIssueStage::tryIssue(InstRef &IR) { Bandwidth = Desc.EndGroup ? 0 : Bandwidth - NumMicroOps; } + // If the instruction has a latency of 0, we need to handle + // the execution and retirement now. + if (IS.isExecuted()) { + PRF.onInstructionExecuted(&IS); + notifyEvent( + HWInstructionEvent(HWInstructionEvent::Executed, IR)); + LLVM_DEBUG(dbgs() << "[E] Instruction #" << IR << " is executed\n"); + + retireInstruction(IR); + return llvm::ErrorSuccess(); + } + IssuedInst.push_back(IR); if (!IR.getInstruction()->getDesc().RetireOOO) diff --git a/tools/llvm-mca/Views/TimelineView.cpp b/tools/llvm-mca/Views/TimelineView.cpp index ceeb267cf11..5cd163cad01 100644 --- a/tools/llvm-mca/Views/TimelineView.cpp +++ b/tools/llvm-mca/Views/TimelineView.cpp @@ -288,8 +288,6 @@ void TimelineView::printTimeline(raw_ostream &OS) const { for (unsigned Iteration = 0; Iteration < Iterations; ++Iteration) { for (const MCInst &Inst : Source) { const TimelineViewEntry &Entry = Timeline[IID]; - if (Entry.CycleRetired == 0) - return; unsigned SourceIndex = IID % Source.size(); printTimelineViewEntry(FOS, Entry, Iteration, SourceIndex);