Page MenuHomePhabricator

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

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



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.Mon, Apr 5, 12:05 AM
skatkov requested review of this revision.Mon, Apr 5, 12:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Apr 5, 12:05 AM
reames requested changes to this revision.Mon, Apr 5, 8:54 AM
reames added inline comments.

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.)


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.


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.Mon, Apr 5, 8:54 AM
skatkov abandoned this revision.Thu, Apr 8, 5:16 AM

abandon in favor of other solution.