This is an archive of the discontinued LLVM Phabricator instance.

[GreedyRA] Add some stats to remark emitter for Greedy RA.
AbandonedPublic

Authored by skatkov on Apr 5 2021, 12:05 AM.

Details

Reviewers
reames
dantrushin
Summary

Adds couple of stats to remark emitter after Greedy RA:

  1. Number of spill/reload instructions without used in statepoint like instruction which does not suffer from stack usage.
  2. Cost of spill/reloads computed as block frequency for each stack usage.
  3. Number of copy instructions with virtual register operands.
  4. Cost of copies computed as block frequency for each copy.

While these numbers highly depends on MIR, they can show interesting information about changes in RA and even can be used as some metric.

Diff Detail

Event Timeline

skatkov created this revision.Apr 5 2021, 12:05 AM
skatkov requested review of this revision.Apr 5 2021, 12:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2021, 12:05 AM
reames requested changes to this revision.Apr 5 2021, 8:54 AM
reames added inline comments.
llvm/lib/CodeGen/RegAllocGreedy.cpp
3121

Please move the majority of the computation logic outside the ORE emit lambda. Leave only the output formatting there. (Just to be consistent with existing code.)

3133

You'll need to restructure this a bit on the changes I suggested for the review adding getNonFoldableRange.

I'll mention that I found the current structure quite confusing. I'd suggest adjusting naming to be clear that what you're interested in is zero cost folding, not whether these is a fold. To the point where it might be useful to have stasts to track each separately.

3156

You need to find some alternate naming here. You're not counting spills, you're counting usages of spills.

You might want to count "folded reloads" and "folded spills" separately?

As an aside, extending the existing reportNumberOfSplillsReloads to report a function level summary as well as the loop level detail would seem quite helpful.

Actually, the more I look at this, the more I think what you actually want is to extend the existing reportNumberOfSplillsReloads logic after extending it the function level.

This revision now requires changes to proceed.Apr 5 2021, 8:54 AM
skatkov abandoned this revision.Apr 8 2021, 5:16 AM

abandon in favor of other solution.