aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Di Biagio <andrea.dibiagio@sony.com>2023-06-19 14:37:22 +0100
committerAndrea Di Biagio <andrea.dibiagio@sony.com>2023-06-19 16:17:33 +0100
commit923dbb01ea6be1ec919d0b71b34551ae91169bc7 (patch)
tree7b8fa762a552a808d503cb051cdd738ec8eac7f2
parent7cfc82f331182855e2634c21d242c3b418f84bd1 (diff)
downloadllvm-923dbb01ea6be1ec919d0b71b34551ae91169bc7.zip
llvm-923dbb01ea6be1ec919d0b71b34551ae91169bc7.tar.gz
llvm-923dbb01ea6be1ec919d0b71b34551ae91169bc7.tar.bz2
[llvm-mca][TimelineView] Skip invalid entries when printing the json output.
-rw-r--r--llvm/tools/llvm-mca/Views/TimelineView.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mca/Views/TimelineView.cpp b/llvm/tools/llvm-mca/Views/TimelineView.cpp
index 5c05edb..2eca48a 100644
--- a/llvm/tools/llvm-mca/Views/TimelineView.cpp
+++ b/llvm/tools/llvm-mca/Views/TimelineView.cpp
@@ -315,6 +315,10 @@ json::Value TimelineView::toJSON() const {
json::Array TimelineInfo;
for (const TimelineViewEntry &TLE : Timeline) {
+ // Check if the timeline-max-cycles has been reached.
+ if (!TLE.CycleRetired && TLE.CycleExecuted)
+ break;
+
TimelineInfo.push_back(
json::Object({{"CycleDispatched", TLE.CycleDispatched},
{"CycleReady", TLE.CycleReady},