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

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 17:30:20 PST 2021


wolfgangp updated this revision to Diff 317121.
wolfgangp marked an inline comment as done.
wolfgangp added a comment.
Herald added a subscriber: mgorny.

This change is trying to use a more streamlined interface based on Andrea's feedback. I removed the printJSON method from the PipelinePrinter and the singleton object that was used to list the instructions. 
Instead, each implemented view now has a <ViewName>JSON derived class that overrides the printView method. When JSON output is requested, objects of these class types are added as views. This leaves the PipelinePrinter largely unchanged.

There is a separate "InstructionView" which lists the instructions and CPU resources. Other views refer to the instructions and resources by index.

The ResourcePRessureView now lists all the non-zero resource usages, referring to the instructions and resources by index.
One thing I was not sure about: The last row of the ResourceUsage matrix has the totals for all iterations. Right now it's just printed as if it belonged to instruction N (with N being the number of instructions). I don't know if we want to do something different.


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/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.317121.patch
Type: text/x-patch
Size: 29030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210116/1b39dd30/attachment.bin>


More information about the llvm-commits mailing list