[llvm] [NFC][InstrProf] Increment valid profile stat in populateCoverage (PR #89660)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 13:16:06 PDT 2024


https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/89660

We increment `NumOfCSPGOFunc` and `NumOfPGOFunc` in `PGOUseFunc::readCounters()` already. We should do the same in `PGOUseFunc::populateCoverage`.

>From 41cd9f180ed3132aa01f54e4040f4a3edd40afa4 Mon Sep 17 00:00:00 2001
From: Ellis Hoag <ellis.sparky.hoag at gmail.com>
Date: Mon, 22 Apr 2024 13:12:57 -0700
Subject: [PATCH] [NFC][InstrProf] Increment valid profile stat in
 populateCoverage

We increment `NumOfCSPGOFunc` and `NumOfPGOFunc` in `PGOUseFunc::readCounters()` already. We should do the same in `PGOUseFunc::populateCoverage`.
---
 llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 98c6f8cbf5afef..a7b7556685e443 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -1367,6 +1367,7 @@ void PGOUseFunc::populateCoverage(IndexedInstrProfReader *PGOReader) {
     handleInstrProfError(std::move(Err), MismatchedFuncSum);
     return;
   }
+  IsCS ? NumOfCSPGOFunc++ : NumOfPGOFunc++;
 
   std::vector<uint64_t> &CountsFromProfile = Result.get().Counts;
   DenseMap<const BasicBlock *, bool> Coverage;



More information about the llvm-commits mailing list