[PATCH] D86644: [llvm-mca] Initial implementation of output serialization using JSON

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 18:12:56 PST 2021


wolfgangp updated this revision to Diff 318077.
wolfgangp added a comment.

Based on Andrea's request to use an OutputKind rather than overriding the printView method in a separate class for JSON output

1. Introduced an output kind into the View class, which is stored in  the PipelinePrinter based on the command line settings. PipelinePrinter passes the output kind to the views' PrintView method(), which dispatches either to the regular printView() or to printViewJSON().
2. Removed the <View>JSON classes and instead added a printViewJSON virtual method which is shared by most views.
3. the toJSON() methods have been moved back to the view classes.

I changed a couple of minor things from Andrea's proposal: 1) I used the name READABLE instead of RAW (the existing output is well formatted, so I felt the name RAW was not quite catching its essence. 2) I overloaded the old PrintView() instead of using a different name.

I didn't address the release note question yet, but I will look into what's needed here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86644/new/

https://reviews.llvm.org/D86644

Files:
  llvm/docs/CommandGuide/llvm-mca.rst
  llvm/test/tools/llvm-mca/JSON/X86/views.s
  llvm/tools/llvm-mca/CMakeLists.txt
  llvm/tools/llvm-mca/PipelinePrinter.cpp
  llvm/tools/llvm-mca/PipelinePrinter.h
  llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp
  llvm/tools/llvm-mca/Views/BottleneckAnalysis.h
  llvm/tools/llvm-mca/Views/DispatchStatistics.h
  llvm/tools/llvm-mca/Views/InstructionInfoView.cpp
  llvm/tools/llvm-mca/Views/InstructionInfoView.h
  llvm/tools/llvm-mca/Views/RegisterFileStatistics.h
  llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
  llvm/tools/llvm-mca/Views/ResourcePressureView.h
  llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.h
  llvm/tools/llvm-mca/Views/SchedulerStatistics.h
  llvm/tools/llvm-mca/Views/SummaryView.cpp
  llvm/tools/llvm-mca/Views/SummaryView.h
  llvm/tools/llvm-mca/Views/TimelineView.cpp
  llvm/tools/llvm-mca/Views/TimelineView.h
  llvm/tools/llvm-mca/Views/View.cpp
  llvm/tools/llvm-mca/Views/View.h
  llvm/tools/llvm-mca/llvm-mca.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86644.318077.patch
Type: text/x-patch
Size: 25216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210121/b6f4b4c4/attachment.bin>


More information about the llvm-commits mailing list