This is an archive of the discontinued LLVM Phabricator instance.

[llvm][NFC] refactor setBlockFrequency for clarity.
ClosedPublic

Authored by mtrofin on Jul 23 2020, 9:21 AM.

Details

Summary

The refactoring encapsulates frequency calculation in MachineBlockFrequencyInfo,
and renames the API to clarify its motivation. It should clarify
frequencies may not be reset 'freely' by users of the analysis, as the
API serves as a partial update to avoid a full analysis recomputation.

Diff Detail

Event Timeline

mtrofin created this revision.Jul 23 2020, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2020, 9:21 AM

Perhaps also keep setBlockFreq as a lower level interface? I am surprised that edge splitting is the only one user of it.

Perhaps also keep setBlockFreq as a lower level interface? I am surprised that edge splitting is the only one user of it.

We can always add it back. Its absence makes things easier to a reader, I think, because it becomes more clear when the analysis result undergoes mutations - i.e. whenever the pass manager requests it, and during edge splitting, as a performance optimization.

davidxl accepted this revision.Jul 28 2020, 9:59 AM

thanks for the cleanup

This revision is now accepted and ready to land.Jul 28 2020, 9:59 AM
This revision was automatically updated to reflect the committed changes.