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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-pgo

Author: Ellis Hoag (ellishg)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/89660.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp (+1) 


``````````diff
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;

``````````

</details>


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


More information about the llvm-commits mailing list