The builtin_expect(), and C++20's likely, unlikely attributes assign branch_weights to annotated branches.
This patch adds the the ability to query branch !prof metadata and improve static analysis based on that.
Differential D159336
Statically analyze likely and unlikely blocks based on metadata hiraditya on Aug 31 2023, 11:02 PM. Authored by
Details The builtin_expect(), and C++20's likely, unlikely attributes assign branch_weights to annotated branches. This patch adds the the ability to query branch !prof metadata and improve static analysis based on that.
Diff Detail Event Timeline
Comment Actions lgtm wth a couple of small test tweaks.
|
Is there an internal option that determines the value used there that can be used in the code here? Looks like it is controlled by LikelyBranchWeight - can that be made a global option and referenced here so that they don't get out of sync?