[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
Fri Apr 5 09:12:53 PDT 2024


================
@@ -1210,12 +1210,22 @@ Instruction *Instruction::cloneImpl() const {
 
 void Instruction::swapProfMetadata() {
   MDNode *ProfileData = getBranchWeightMDNode(*this);
-  if (!ProfileData || ProfileData->getNumOperands() != 3)
+  if (!isBranchWeightMD(ProfileData))
----------------
ilovepi wrote:

Oh, that's a good point. In my head these were all tied together w/ the change to the metadata layout, but maybe I can restructure ProfdataUtils first, and then update the surrounding code, and after that's done introduce the metadata changes. Thanks for the suggestion. I'll take a pass at that soon.

https://github.com/llvm/llvm-project/pull/86609


More information about the llvm-branch-commits mailing list