There are several places where views generate an ASCII form of a machine instruction. Use a helper function.
This is another preparatory patch for JSON generation.
Paths
| Differential D86390
[llvm-mca][NFC] Refactor instruction printing AcceptedPublic Authored by wolfgangp on Aug 21 2020, 7:26 PM.
Details
Summary There are several places where views generate an ASCII form of a machine instruction. Use a helper function. This is another preparatory patch for JSON generation.
Diff Detail Event TimelineComment Actions I believe this is going to regress normal codepath in terms of avoidable memory allocations.
This revision now requires changes to proceed.Aug 22 2020, 2:01 PM Comment Actions Here is another proposal: We're using statics for the Instruction string and the stream to write it and return a reference to it. This is not MT-capable but I don't think this is a requirement for printing views. Comment Actions After some consultation with @andreadb this is some more extensive refactoring: All this has the effect that only views that we don't use any globals for instruction printing while simplifying the code.
Comment Actions Looks better i guess, thanks. This revision is now accepted and ready to land.Aug 25 2020, 6:19 AM
Revision Contents
Diff 287525 llvm/tools/llvm-mca/Views/BottleneckAnalysis.h
llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp
llvm/tools/llvm-mca/Views/InstructionInfoView.h
llvm/tools/llvm-mca/Views/InstructionInfoView.cpp
llvm/tools/llvm-mca/Views/ResourcePressureView.h
llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
llvm/tools/llvm-mca/Views/TimelineView.h
llvm/tools/llvm-mca/Views/TimelineView.cpp
llvm/tools/llvm-mca/Views/View.h
|
Remove const.