Set default branch weight to 1:1 if one of the branch has profile missing when simplifying CFG.
Details
Details
Diff Detail
Diff Detail
Event Timeline
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? |
Comment Actions
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).
Comment Actions
The test is validated. For most cases, the prof id just shifted by one. For
test1 and test3, the changes are intended.
Dehao
Can you refactor the code into a helper function:
extractPredSuccWeights that returns true if either Pred or Succ has weights?