This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Add extra counters for move elimination in view RegisterFileStatistics.
ClosedPublic

Authored by andreadb on Nov 1 2018, 7:15 AM.

Details

Summary

This patch teaches view RegisterFileStatistics how to report events for optimizable register moves.

For each processor register file, view RegisterFileStatistics reports the following extra information:

  • Number of optimizable register moves
  • Number of register moves eliminated
  • Number of zero moves (i.e. register moves that propagate a zero)
  • Max Number of moves eliminated per cycle.

Let me know if okay to commit.

Thanks,
Andrea

Diff Detail

Repository
rL LLVM

Event Timeline

andreadb created this revision.Nov 1 2018, 7:15 AM
mattd accepted this revision.Nov 1 2018, 10:20 AM

LGTM.

tools/llvm-mca/Views/RegisterFileStatistics.cpp
25 ↗(On Diff #172119)

You should be able to value initialize this RFUEmpty = {0}; MEIEmpty = {0};

tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp
404 ↗(On Diff #172119)

I think this routine can be marked const.

This revision is now accepted and ready to land.Nov 1 2018, 10:20 AM
RKSimon added inline comments.Nov 1 2018, 10:30 AM
tools/llvm-mca/Views/RegisterFileStatistics.cpp
61 ↗(On Diff #172119)

(style)

if (!Inst.isOptimizableMove())
  return;
This revision was automatically updated to reflect the committed changes.