[compiler-rt] [clang] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

Zequan Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 15 09:03:16 PST 2023


================
@@ -234,8 +246,20 @@ struct MapRegionCounters : public RecursiveASTVisitor<MapRegionCounters> {
     if (Hash.getHashVersion() == PGO_HASH_V1)
       return Base::TraverseIfStmt(If);
 
+    // When single byte coverage mode is enabled, add a counter to then and
+    // else.
+    for (Stmt *CS : If->children()) {
+      if (!CS || !llvm::EnableSingleByteCoverage)
----------------
ZequanWu wrote:

Maybe hoist `llvm::EnableSingleByteCoverage` outside the loop as this is not going to change. Same for the following.

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


More information about the cfe-commits mailing list