zequanwu added a comment.

In D157632#4581219 <https://reviews.llvm.org/D157632#4581219>, @ellis wrote:

> In D157632#4580576 <https://reviews.llvm.org/D157632#4580576>, @zequanwu 
> wrote:
>
>> BTW, I noticed something strange with `-pgo-function-entry-coverage` when 
>> merging via llvm-profdata.
>
> This is intentional. The two raw profiles individually store blocks as either 
> covered or not, but when we merge them they get converted to counters and 
> accumulated.
> https://github.com/llvm/llvm-project/blob/6a0feb1503e21432e63d93b44357bad43f8026d1/llvm/lib/ProfileData/InstrProf.cpp#L726
> Then in `PGOUseFunc::populateCoverage()` we annotate blocks as alive if their 
> counter value is non-zero.
> https://github.com/llvm/llvm-project/blob/1aee2434ce4c9b5785cbc8f72cbbbd64f9e85297/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#L1399
> My logic was that the indexed profile represents these counters as ints, so 
> we might as well accumulate them. Also, this makes the implementation simpler.

Thanks for explanation. That makes sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157632

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to