[llvm-branch-commits] [llvm] [IR][PGO] Verify the structure of `VP` metadata. (PR #145584)

Mircea Trofin via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 24 13:54:59 PDT 2025


https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/145584

>From a9742de1b38e1745268e970845d187108ba292bf Mon Sep 17 00:00:00 2001
From: Mircea Trofin <mtrofin at google.com>
Date: Tue, 24 Jun 2025 13:14:09 -0700
Subject: [PATCH] [IR][PGO] Verify the structure of `VP` metadata.

---
 llvm/lib/IR/Verifier.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index ae95e3e2bff8d..4236d9bb9630b 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -5008,9 +5008,10 @@ void Verifier::visitProfMetadata(Instruction &I, MDNode *MD) {
       Check(mdconst::dyn_extract<ConstantInt>(MDO),
             "!prof brunch_weights operand is not a const int");
     }
+  } else if (ProfName == "VP") {
+    
   } else {
-    Check(ProfName == "VP", "expected either branch_weights or VP profile name",
-          MD);
+    CheckFailed("expected either branch_weights or VP profile name", MD);
   }
 }
 



More information about the llvm-branch-commits mailing list