================ @@ -940,15 +939,35 @@ struct CounterCoverageMappingBuilder std::pair<Counter, Counter> getBranchCounterPair(const Stmt *S, Counter ParentCnt) { - Counter ExecCnt = getRegionCounter(S); - return {ExecCnt, Builder.subtract(ParentCnt, ExecCnt)}; + auto &TheMap = CounterMap[S]; + auto ExecCnt = Counter::getCounter(TheMap.first); ---------------- chapuni wrote:
I guess it assumes `S` always hit. The logic is similar to the current implementation. `TheMap` will be allocated with an initial value if `S` doesn't hit. We can introduce more strict checks. https://github.com/llvm/llvm-project/pull/120930 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits