[PATCH] D157632: [Profile] Allow online merging with debug info correlation.

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 11 08:49:21 PDT 2023


zequanwu added a comment.

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

> I've just published https://reviews.llvm.org/D157664, so you'll want to rebase ontop of it if it lands soon. I would also like to see some more tests added to `instrprof-merge-error.c` to make sure two different binaries can't merge profiles together with `--debug-info-correlate`. I was thinking the test would be something like this.
>
>   // RUN: %clang_pgogen -o %t/a -g -mllvm --debug-info-correlate -mllvm --disable-vp=true %t/main.c
>   // RUN: %clang_pgogen -o %t/b -g -mllvm --debug-info-correlate -mllvm --disable-vp=true %t/main.c %t/foo.c
>   // RUN: env LLVM_PROFILE_FILE=%t/default_%m.profdata %run %t/a
>   // This next line should fail to merge because the counter sections have different sizes
>   // RUN: env LLVM_PROFILE_FILE=%t/default_%m.profdata %run %t/b
>   
>   //--- main.c
>   int main() { return 0; }
>   //--- foo.c
>   int foo() { return 4; }

In this example, `%m` will translated to two different values so they won't be merged. As I mentioned in the inline comment, `__llvm_profile_check_compatibility` will verify that for us.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157632



More information about the cfe-commits mailing list