Clarify the relation between a block's BlockFrequency and the
getEntryFreq() API, and added an API for the relatively common case of
finding a block's frequency relative to the entrypoint.
Added / moved some comments to header.
Paths
| Differential D84357
[llvm][NFC] Add comments and common-case API to MachineBlockFrequencyInfo ClosedPublic Authored by mtrofin on Jul 22 2020, 1:00 PM.
Details Summary Clarify the relation between a block's BlockFrequency and the Added / moved some comments to header.
Diff Detail
Event Timeline
mtrofin marked 2 inline comments as done. Comment Actionsfeedback
This revision is now accepted and ready to land.Jul 23 2020, 8:23 AM Closed by commit rG302e91baf4fa: [llvm][NFC] Add comments and common-case API to MachineBlockFrequencyInfo (authored by mtrofin). · Explain WhyJul 23 2020, 8:42 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 280145 llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
llvm/lib/CodeGen/LiveIntervals.cpp
llvm/lib/CodeGen/RegAllocPBQP.cpp
|
I'd go with "Entry" (or "EntryBlock") rather than "Entrypoint" here (and also in the new comments), as I don't think the latter is used around here.
Also, I'd use float instead of double and add parentheses around the division (so the "1.0 / ..." part
happens before the multiplication) to preserve the original spill cost formula below exactly. Slight errors might matter (might not but to be safe.)