[llvm-mca] Move the logic that computes the register file usage to the BackendStatist...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 21 Mar 2018 18:11:05 +0000 (18:11 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 21 Mar 2018 18:11:05 +0000 (18:11 +0000)
commit12ef5260ea2fada35c830266e926441c671cf5a5
tree31bbebb837ec96827d4be3898cfaa302a56bb9cc
parent949437e8829d93e5110ab1c68fbe7359d3a5f34c
[llvm-mca] Move the logic that computes the register file usage to the BackendStatistics view.

With this patch, the "instruction dispatched" event now provides information
related to the number of microarchitectural registers used in each register
file. Similarly, the "instruction retired" event is now able to tell how may
registers are freed in each register file.

Currently, the BackendStatistics view is the only consumer of register
usage/pressure information. BackendStatistics uses that info to print out a few
general statistics (i.e. max number of mappings used; total mapping created).
Before this patch, the BackendStatistics was forced to query the Backend to
obtain the register pressure information.

This helps removes that dependency. Now views are completely independent from
the Backend.  As a consequence, it should be easier to address PR36663 and
further modularize the pipeline.

Added a couple of test cases in the BtVer2 specific directory.

llvm-svn: 328129
llvm/test/tools/llvm-mca/X86/BtVer2/register-files-1.s [new file with mode: 0644]
llvm/test/tools/llvm-mca/X86/BtVer2/register-files-2.s [new file with mode: 0644]
llvm/tools/llvm-mca/Backend.h
llvm/tools/llvm-mca/BackendStatistics.cpp
llvm/tools/llvm-mca/BackendStatistics.h
llvm/tools/llvm-mca/Dispatch.cpp
llvm/tools/llvm-mca/Dispatch.h
llvm/tools/llvm-mca/HWEventListener.h
llvm/tools/llvm-mca/llvm-mca.cpp