[PATCH] D146452: [AutoFDO] Use flattened profiles for profile staleness metrics

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 10:24:35 PDT 2023


wlei added inline comments.


================
Comment at: llvm/test/tools/llvm-profdata/sample-flatten-profile.test:6
+; RUN: llvm-profdata merge --sample --extbinary %S/Inputs/sample-flatten-profile-cs.proftext -o %t2 && llvm-profdata merge --sample --convert-sample-profile-layout=flat --text %t2 -o - | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=CHECK-CS
+
+; CHECK:baz:169:10
----------------
bjope wrote:
> Downstream I got this when building with expensive checks:
> 
> 
> ```
> Command Output (stderr):
> --
> /repo/bbiswjenk/fem2s10-eiffel176/workspace/llvm/llvm-main-expensive-checks/llvm/test/tools/llvm-profdata/sample-flatten-profile.test:13:14: error: CHECK-NEXT: expected string not found in input
> ; CHECK-NEXT: !CFGChecksum: 1
>              ^
> <stdin>:6:7: note: scanning from here
>  10: 1
>       ^
> <stdin>:7:2: note: possible intended match here
>  !CFGChecksum: 0
>  ^
> 
> Input file: <stdin>
> Check file: /repo/bbiswjenk/fem2s10-eiffel176/workspace/llvm/llvm-main-expensive-checks/llvm/test/tools/llvm-profdata/sample-flatten-profile.test
> 
> -dump-input=help explains the following input dump.
> 
> Input was:
> <<<<<<
>            1: baz:169:10 
>            2:  1: 10 
>            3:  3: 20 
>            4:  5: 20 foo:20 
>            5:  6: 2 bar:2 
>            6:  10: 1 
> next:13'0           X error: no match found
>            7:  !CFGChecksum: 0 
> next:13'0     ~~~~~~~~~~~~~~~~~
> next:13'1      ?                possible intended match
>            8: foo:134:21 
> next:13'0     ~~~~~~~~~~~
>            9:  1: 21 
> next:13'0     ~~~~~~~
>           10:  3: 12 bar:11 
> next:13'0     ~~~~~~~~~~~~~~
>           11:  4: 1 
> next:13'0     ~~~~~~
>           12:  !CFGChecksum: 3 
> next:13'0     ~~~~~~~~~~~~~~~~~
>            .
>            .
>            .
> >>>>>>
> ```
> 
> Although I haven't seen that in any upstream buildbot.
> 
> Could it perhaps be that the order in which things are outputted is sensitive to iteration order of some maps?
> FWIW, SampleProfileMap is an UnorderedMap and you are at least iterating over such maps in a few places (and I think SampleProfReader/SampleProfWriter is using sortFuncProfiles to sort map entries when needed).
Thanks for the comment. You're right, the checksum num should be the same for the same func name profile, I missed adding one checksum, it should be fixed by https://reviews.llvm.org/rG3520f6d66645.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146452



More information about the llvm-commits mailing list