This is an archive of the discontinued LLVM Phabricator instance.

Add getBlockProfileCount method to BlockFrequencyInfo
ClosedPublic

Authored by eraman on Mar 16 2016, 4:29 PM.

Details

Summary

Deriving the count of a block from function's entry count and block's relative frequency is a useful utility. At present, ProfileCommon.h has a function that just does the arithmetic, and still needs to be passed the BFI of the block. Moving it to BFI makes it easier to use.

Diff Detail

Event Timeline

eraman updated this revision to Diff 50892.Mar 16 2016, 4:29 PM
eraman retitled this revision from to Add getBlockProfileCount method to BlockFrequencyInfo.
eraman updated this object.
eraman added reviewers: dexonsmith, tejohnson.
eraman added a subscriber: davidxl.

I don't see any existing unittests covering BFI interfaces, it might be a good opportunity to add one.

eraman updated this revision to Diff 50997.Mar 17 2016, 5:19 PM

Added a unit test for BlockFrequencyInfo

tejohnson edited edge metadata.Mar 21 2016, 8:42 AM

Looks like a good cleanup to me. You can clean up includes as noted below.

lib/Bitcode/Writer/BitcodeWriter.cpp
37

This include can presumably be removed with this change.

davidxl accepted this revision.Mar 22 2016, 2:10 PM
davidxl added a reviewer: davidxl.

lgtm (after addressing Teresa's comment)

This revision is now accepted and ready to land.Mar 22 2016, 2:10 PM
eraman updated this revision to Diff 51359.Mar 22 2016, 3:52 PM
eraman edited edge metadata.

Remove unused header

eraman marked an inline comment as done.Mar 22 2016, 3:53 PM

Dexon, does this patch look ok?

This revision was automatically updated to reflect the committed changes.