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.
Paths
| Differential D159336
Statically analyze likely and unlikely blocks based on metadata ClosedPublic Authored by hiraditya on Aug 31 2023, 11:02 PM.
Details Summary 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
hiraditya added inline comments.
Comment Actions lgtm wth a couple of small test tweaks.
This revision is now accepted and ready to land.Sep 11 2023, 7:36 PM This revision was landed with ongoing or failed builds.Sep 12 2023, 11:29 AM Closed by commit rGf061b131757b: Statically analyze likely and unlikely blocks based on metadata (authored by AdityaK <1894981+hiraditya@users.noreply.github.com>). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 556599 llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
llvm/lib/Transforms/IPO/HotColdSplitting.cpp
llvm/test/Transforms/HotColdSplit/split-static-profile.ll
|
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?