================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to