Reapply "[MCA] Adding the CustomBehaviour class to llvm-mca".
authorPatrick Holland <patrickeholland@gmail.com>
Wed, 16 Jun 2021 15:22:54 +0000 (16:22 +0100)
committerAndrea Di Biagio <andrea.dibiagio@sony.com>
Wed, 16 Jun 2021 15:54:48 +0000 (16:54 +0100)
commitef16c8eaa5cd567975956ec0b52b3648365a8ba1
treeac22deb46878a3e9f4e871320cb9d99e3b62baf4
parentb5c4fc0f232b6368bbd7cd8681a6931f2c30ad02
Reapply "[MCA] Adding the CustomBehaviour class to llvm-mca".

The original change was pushed in main as commit f7a23ecece52.
It was then reverted by commit a04f01bab2 because it caused linker failures
on buildbots that don't build the AMDGPU target.

--

Some instructions are not defined well enough within the target’s scheduling
model for llvm-mca to be able to properly simulate its behaviour. The ideal
solution to this situation is to modify the scheduling model, but that’s not
always a viable strategy. Maybe other parts of the backend depend on that
instruction being modelled the way that it is. Or maybe the instruction is quite
complex and it’s difficult to fully capture its behaviour with tablegen. The
CustomBehaviour class (which I will refer to as CB frequently) is designed to
provide intuitive scaffolding for developers to implement the correct modelling
for these instructions.

More details are available in the original commit log message (f7a23ecece52).

Differential Revision: https://reviews.llvm.org/D104149
18 files changed:
llvm/docs/CommandGuide/llvm-mca.rst
llvm/include/llvm/MCA/Context.h
llvm/include/llvm/MCA/CustomBehaviour.h [new file with mode: 0644]
llvm/include/llvm/MCA/HWEventListener.h
llvm/include/llvm/MCA/Instruction.h
llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
llvm/lib/MCA/CMakeLists.txt
llvm/lib/MCA/Context.cpp
llvm/lib/MCA/CustomBehaviour.cpp [new file with mode: 0644]
llvm/lib/MCA/InstrBuilder.cpp
llvm/lib/MCA/Stages/InOrderIssueStage.cpp
llvm/tools/llvm-mca/CMakeLists.txt
llvm/tools/llvm-mca/Views/DispatchStatistics.cpp
llvm/tools/llvm-mca/lib/AMDGPU/AMDGPUCustomBehaviour.cpp [new file with mode: 0644]
llvm/tools/llvm-mca/lib/AMDGPU/AMDGPUCustomBehaviour.h [new file with mode: 0644]
llvm/tools/llvm-mca/lib/AMDGPU/CMakeLists.txt [new file with mode: 0644]
llvm/tools/llvm-mca/lib/CMakeLists.txt [new file with mode: 0644]
llvm/tools/llvm-mca/llvm-mca.cpp