[llvm] LoopVectorize: Set branch_weight for conditional branches (PR #72450)
David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 13:58:06 PST 2023
david-xl wrote:
> There is no measurable performance change from that on our end. I am merely hunting down conditional branches without `branch_weight` annotations which I think we can agree are never desirable in a function that has otherwise profile annotations.
Agree in general, but there might be undesirable outcome in some cases. There are 3 types of missing annotations: 1) real profile gets dropped; 2) real profile is unknown (due to lack of flow sensitivity) for a clone, but can be reasonablily guessed with scaling; and 3) new branches that require static heuristic to guess. It is the 3) category that can be problematic. In the code, I added a question on the default values.
https://github.com/llvm/llvm-project/pull/72450
More information about the llvm-commits
mailing list