[llvm] [PGO] Don't unconditionally request BBInfo in verifyFuncBFI() (PR #140804)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 17:53:16 PDT 2025


================
@@ -2086,10 +2086,12 @@ static void verifyFuncBFI(PGOUseFunc &Func, LoopInfo &LI,
 
   unsigned BBNum = 0, BBMisMatchNum = 0, NonZeroBBNum = 0;
   for (auto &BBI : F) {
-    uint64_t CountValue = 0;
-    uint64_t BFICountValue = 0;
+    PGOUseBBInfo *BBInfo = Func.findBBInfo(&BBI);
+    if (!BBInfo)
+      continue;
----------------
mingmingl-llvm wrote:

In an FDO-optimized build, hash mismatch errors are detected and logged (https://github.com/llvm/llvm-project/blob/744a469bbadb282c58e39b2c76008352f42e7e1a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#L1431-L1438).

Is it feasible to use similar mechanism to log the error here?

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


More information about the llvm-commits mailing list