[PATCH] D23224: Fine tuning of sample profile propagation algorithm.

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 11:44:47 PDT 2016


danielcdh added a comment.

The changes includes:

- Not use branch instruction and intrinsic instruction for annotation because their debug info is usually incorrect.
- Hoist the check of whether a callsite was inlined in the profile but not in annotation. Because we are confident that these callsites are cold.
- If any BB in an equivalence class is annotated, set the entire equivalence class as annotated.
- When setting the wait, add the weight by one to ensure all weights are at least 1. This is trying to avoid propagation error when the weight is 0.
- Add a propagateThroughEdge pass with all edge weights reset to 0 to recompute edge weight from propagated block weights.
- Add a propagateThroughEdge pass in which basic block count can amended when it's apparently incorrect.
- If computed unknown edge weight exceeds its pred/succ block's weight, reduce its weight to pred/succ block's weight
- When block count is 0, all its pred/succ edge count is set to 0
- Adjust block header weights to be no less than all basic blocks inside the loop

These changes are all from tuning google applications for a long period of time, so it will be hard to get unittests to show effects for each one of them. But they combined to show big difference: for the legacy unittests, the changes have corrected some incorrect annotations.


https://reviews.llvm.org/D23224





More information about the llvm-commits mailing list