This is an archive of the discontinued LLVM Phabricator instance.

[BranchFolding] Replace MachineBlockFrequencyInfo with MBFIWrapper. NFC.
ClosedPublic

Authored by haicheng on May 11 2016, 3:26 PM.

Details

Summary

Another part of enabling BranchFolding in MBP.

BranchFolding changes the CFG and stores the updated MachineBlockFrequencyInfo inside the MBFIWrapper. This patch allows other passes that call BranchFolding use the updated MachineBlockFrequencyInfo without recalculation.

Besides cutting and pasting, I added two more print functions for the debugging purpose.

Diff Detail

Repository
rL LLVM

Event Timeline

haicheng updated this revision to Diff 56971.May 11 2016, 3:26 PM
haicheng retitled this revision from to [BranchFolding] Factor out MBFIWrapper class. NFC..
haicheng updated this object.
haicheng set the repository for this revision to rL LLVM.
haicheng updated this object.May 11 2016, 3:29 PM
haicheng updated this revision to Diff 56993.May 11 2016, 8:44 PM
haicheng retitled this revision from [BranchFolding] Factor out MBFIWrapper class. NFC. to [BranchFolding] Replace MachineBlockFrequencyInfo with MBFIWrapper. NFC..
haicheng added reviewers: mcrosier, gberry, mssimpso.
haicheng added subscribers: hfinkel, iteratee, llvm-commits.

Cleanup the code.

haicheng updated this revision to Diff 57099.May 12 2016, 2:18 PM

Fix a bug.

gberry resigned from this revision.May 23 2016, 3:25 PM
gberry removed a reviewer: gberry.
mssimpso added inline comments.May 25 2016, 8:20 AM
lib/CodeGen/BranchFolding.h
29 ↗(On Diff #57099)

Do you need to take this class out of the BranchFolder scope or would a forward declaration work?

haicheng added inline comments.May 25 2016, 8:50 AM
lib/CodeGen/BranchFolding.h
29 ↗(On Diff #57099)

Forward declaration works. At first I just wanted to type less letters when this class is used outside of BranchFolder :)

haicheng updated this revision to Diff 58546.May 25 2016, 5:32 PM
haicheng marked 2 inline comments as done.

Address Matt's comment. Thank you.

mcrosier accepted this revision.Jun 3 2016, 1:19 PM
mcrosier edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jun 3 2016, 1:19 PM
This revision was automatically updated to reflect the committed changes.