[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)
Paul Kirth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Apr 22 09:07:59 PDT 2024
================
@@ -55,6 +55,20 @@ MDNode *getBranchWeightMDNode(const Instruction &I);
/// Nullptr otherwise.
MDNode *getValidBranchWeightMDNode(const Instruction &I);
+/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect*
+/// intrinsic
+bool hasExpectedProvenance(const Instruction &I);
+
+/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect*
+/// intrinsic
+bool hasExpectedProvenance(const MDNode *ProfileData);
+
+/// Return the offset to the first branch weight data
+unsigned getBranchWeightOffset(const Instruction &I);
----------------
ilovepi wrote:
That's a fair point. IIRC I needed this someplace, but maybe I'm mis-remembering and that's a moot point. I'll look at my follow up patches to ensure it isn't required.
https://github.com/llvm/llvm-project/pull/86609
More information about the llvm-branch-commits
mailing list