1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[MCA][TimelineView] Fixed a bug that was causing instructions outside of the timeline-max-cycles to still be printed.

Differential Revision: https://reviews.llvm.org/D104815
This commit is contained in:
Patrick Holland 2021-06-23 13:03:16 -07:00
parent 6c523b4fc3
commit d745bb18b1

View File

@ -288,6 +288,15 @@ void TimelineView::printTimeline(raw_ostream &OS) const {
for (unsigned Iteration = 0; Iteration < Iterations; ++Iteration) { for (unsigned Iteration = 0; Iteration < Iterations; ++Iteration) {
for (const MCInst &Inst : Source) { for (const MCInst &Inst : Source) {
const TimelineViewEntry &Entry = Timeline[IID]; const TimelineViewEntry &Entry = Timeline[IID];
// When an instruction is retired after timeline-max-cycles,
// its CycleRetired is left at 0. However, it's possible for
// a 0 latency instruction to be retired during cycle 0 and we
// don't want to early exit in that case. The CycleExecuted
// attribute is set correctly whether or not it is greater
// than timeline-max-cycles so we can use that to ensure
// we don't early exit because of a 0 latency instruction.
if (Entry.CycleRetired == 0 && Entry.CycleExecuted != 0)
return;
unsigned SourceIndex = IID % Source.size(); unsigned SourceIndex = IID % Source.size();
printTimelineViewEntry(FOS, Entry, Iteration, SourceIndex); printTimelineViewEntry(FOS, Entry, Iteration, SourceIndex);