This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Move the logic that computes the register file usage to the BackendStatistics view.
ClosedPublic

Authored by andreadb on Mar 21 2018, 9:24 AM.

Details

Reviewers
RKSimon
courbet
Summary

With this patch, the "instruction dispatched" event now provides information related to the number of microarchitectural registers used by the instructio in each register file. Similarly, the "instruction retired" event is 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.

Diff Detail

Event Timeline

andreadb created this revision.Mar 21 2018, 9:24 AM
courbet accepted this revision.Mar 21 2018, 9:53 AM
This revision is now accepted and ready to land.Mar 21 2018, 9:53 AM
RKSimon added inline comments.Mar 21 2018, 9:58 AM
tools/llvm-mca/BackendStatistics.cpp
28

const auto for casts - we already know the type

40

const auto for casts - we already know the type

andreadb updated this revision to Diff 139331.Mar 21 2018, 10:52 AM

Patch updated.

Addressed review comments.

RKSimon accepted this revision.Mar 21 2018, 10:55 AM

LGTM - thanks

andreadb closed this revision.Mar 21 2018, 11:14 AM

Thanks.
Committed revision 328129.