[llvm-mca] Add flag -instruction-tables to print the theoretical resource pressure...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Mon, 26 Mar 2018 12:04:53 +0000 (12:04 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Mon, 26 Mar 2018 12:04:53 +0000 (12:04 +0000)
commitd1569290efa3b6b647faec6f0a8e3cc40be40b6b
tree8bf3157692696754df1f30a879db90ecb6f6e9ae
parent5af3fb2b94bf21c0be40da03302e7169bc7d61a3
[llvm-mca] Add flag -instruction-tables to print the theoretical resource pressure distribution for instructions (PR36874)

The goal of this patch is to address most of PR36874.  To fully fix PR36874 we
need to split the "InstructionInfo" view from the "SummaryView". That would make
easy to check the latency and rthroughput as well.

The patch reuses all the logic from ResourcePressureView to print out the
"instruction tables".

We have an entry for every instruction in the input sequence. Each entry reports
the theoretical resource pressure distribution. Resource pressure is uniformly
distributed across all the processor resource units of a group.

At the moment, the backend pipeline is not configurable, so the only way to fix
this is by creating a different driver that simply sends instruction events to
the resource pressure view.  That means, we don't use the Backend interface.
Instead, it is simpler to just have a different code-path for when flag
-instruction-tables is specified.

Once Clement addresses bug 36663, then we can port the "instruction tables"
logic into a stage of our configurable pipeline.

Updated the BtVer2 test cases (thanks Simon for the help). Now we pass flag
-instruction-tables to each modified test.

Differential Revision: https://reviews.llvm.org/D44839

llvm-svn: 328487
16 files changed:
llvm/docs/CommandGuide/llvm-mca.rst
llvm/test/tools/llvm-mca/X86/BtVer2/resources-aes.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-clmul.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse1.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse3.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse41.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse42.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse4a.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-ssse3.s
llvm/tools/llvm-mca/CMakeLists.txt
llvm/tools/llvm-mca/InstrBuilder.h
llvm/tools/llvm-mca/InstructionTables.cpp [new file with mode: 0644]
llvm/tools/llvm-mca/InstructionTables.h [new file with mode: 0644]
llvm/tools/llvm-mca/llvm-mca.cpp