This is an archive of the discontinued LLVM Phabricator instance.

Follow-up patch of http://reviews.llvm.org/D19948 to handle missing profiles when simplifying CFG.
ClosedPublic

Authored by danielcdh on May 16 2016, 3:19 PM.

Diff Detail

Event Timeline

danielcdh updated this revision to Diff 57410.May 16 2016, 3:19 PM
danielcdh retitled this revision from to Follow-up patch of http://reviews.llvm.org/D19948 to handle missing profiles when simplifying CFG..
danielcdh updated this object.
danielcdh added reviewers: davidxl, spatel.
danielcdh added a subscriber: llvm-commits.
davidxl added inline comments.May 18 2016, 11:23 AM
lib/Transforms/Utils/SimplifyCFG.cpp
2256

Can you refactor the code into a helper function:

extractPredSuccWeights that returns true if either Pred or Succ has weights?

danielcdh updated this revision to Diff 57667.May 18 2016, 12:55 PM

Refactor the common helper function.

davidxl accepted this revision.May 18 2016, 2:56 PM
davidxl edited edge metadata.

lgtm

The code change looks fine to me -- but I have not audited the test case changes. Please do this at some point if not done(validate the output BP make sense -- there could be bugs exposed else where).

This revision is now accepted and ready to land.May 18 2016, 2:56 PM

The test is validated. For most cases, the prof id just shifted by one. For
test1 and test3, the changes are intended.

Dehao

danielcdh closed this revision.May 18 2016, 3:47 PM