[PATCH] D124490: [InstrProf] Minimal Block Coverage

Gulfem Savrun Yeniceri via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 17:48:28 PDT 2022


gulfem added a comment.

Hi @ellis,

This is exciting for us! We are interested in using single byte booleans for `source-based code coverage`, and I am currently working on the implementation.
We are trying to find a good solution to the problem that you described that missing counts cannot be inferred by doing arithmetic on other block counts when we use boolean counters.
For ex, in an `if` statement, `else` part is not instrumented, and its counter is inferred by subtracting `parent` and `then` counters.
When we use the boolean values for counters, this cannot be done anymore.
Simpler approach is to instrument more basic blocks, but we are exploring approaches that add counters to minimal blocks.
One of the biggest differences of `coverage` and `PGO` is that counters are emitted by traversing `AST` nodes in the front-end for `coverage`, whereas they are emitted by traversing `CFG` nodes for PGO.
The algorithm that you introduced is based on `CFG` traversal. I'm looking at that to see whether this can be repurposed it for `coverage`.

A few questions:

1. You mentioned that "we found that only ~60% of basic blocks need to be instrumented". With boolean counters, do you how much that has changed?
2. Size reduction is great! Do you have any data on the impact of block coverage on compilation time and runtime performance? For `coverage`, we are also aiming runtime performance with boolean counters.
3. Did you do any verification to compare the correctness of block coverage like comparing it against block counts?

It seems like we are trying to solve similar problems in different contexts, so we would be very interested in collaboration.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124490/new/

https://reviews.llvm.org/D124490



More information about the llvm-commits mailing list