[PATCH] D43951: [RFC] llvm-mca: a static performance analysis tool.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 05:22:00 PST 2018


courbet added inline comments.


================
Comment at: tools/llvm-mca/BackendPrinter.cpp:170
+
+  if (RPV) {
+    RPV->printResourcePressure(getOStream(), Cycles);
----------------
Instead of:

```
BackendPrinter::AddView1(args) { View1 = make_unique<View1>(args); } 
BackendPrinter::AddView2(args) { View2 = make_unique<View2>(args); } 

BackendPrinter::print() const {
  if (View1) {
    View1->printView1();
  }
  if (View2) {
    View2->printView1();
  }
}
```

what about creating a `BackendView` interface and do:

```
BackendPrinter::AddView(std::unique_ptr<View>) { Views.push_back(std::move(View)); } 

BackendPrinter::print() const {
  for (const auto& View : Views) {
    View->print(getOStream(), B);
  }
}
```

It would make it easier to add custom views to the output, and unify the API for various views (printDispatchStalls(), printRATStatistics() , printGeneralStatistics(), printSchedulerUsage() become views).






================
Comment at: tools/llvm-mca/TimelineView.h:138
+  };
+  std::vector<TimelineViewEntry> Timeline;
+
----------------
It seems that this is used only by printTimeline(), and WaitTime is used only by printAverageWaitTimes(), is there any reason to not split TimelineView into TimelineView and WaitTimeView ?


https://reviews.llvm.org/D43951





More information about the llvm-commits mailing list