1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/tools/llvm-profdata/cs-sample-trimmer.test
Wenlei He e734b4c21b [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles
The change adds support for triming and merging cold context when mergine CSSPGO profiles using llvm-profdata. This is similar to the context profile trimming in llvm-profgen, however the flexibility to trim cold context after profile is generated can be useful.

Differential Revision: https://reviews.llvm.org/D100528
2021-04-22 00:42:37 -07:00

43 lines
1.9 KiB
Plaintext

RUN: llvm-profdata merge --sample --text -output=%t.proftext %S/Inputs/cs-sample.proftext
RUN: diff -b %t.proftext %S/Inputs/cs-sample.proftext
RUN: llvm-profdata merge --sample --text -output=%t.proftext %S/Inputs/cs-sample.proftext -sample-merge-cold-context -profile-summary-cold-count=500
RUN: FileCheck %s --input-file %t.proftext --check-prefixes=CHECK-TRIM,CHECK-MERGE
RUN: llvm-profdata merge --sample --text -output=%t.proftext %S/Inputs/cs-sample.proftext -sample-merge-cold-context -sample-trim-cold-context -profile-summary-cold-count=500
RUN: FileCheck %s --input-file %t.proftext --check-prefixes=CHECK-TRIM,CHECK-END
RUN: llvm-profdata merge --sample --text -output=%t.proftext %S/Inputs/cs-sample.proftext -sample-merge-cold-context -sample-trim-cold-context -profile-summary-cutoff-cold=990000
RUN: FileCheck %s --input-file %t.proftext --check-prefixes=CHECK-TRIM,CHECK-END
CHECK-TRIM: [main:3 @ _Z5funcAi:1 @ _Z8funcLeafi]:1467299:11
CHECK-TRIM-NEXT: 0: 6
CHECK-TRIM-NEXT: 1: 6
CHECK-TRIM-NEXT: 3: 287884
CHECK-TRIM-NEXT: 4: 287864 _Z3fibi:315608
CHECK-TRIM-NEXT: 15: 23
CHECK-TRIM-NEXT: !Attributes: 0
CHECK-TRIM-NEXT: [main:3.1 @ _Z5funcBi:1 @ _Z8funcLeafi]:500853:20
CHECK-TRIM-NEXT: 0: 15
CHECK-TRIM-NEXT: 1: 15
CHECK-TRIM-NEXT: 3: 74946
CHECK-TRIM-NEXT: 4: 74941 _Z3fibi:82359
CHECK-TRIM-NEXT: 10: 23324
CHECK-TRIM-NEXT: 11: 23327 _Z3fibi:25228
CHECK-TRIM-NEXT: 15: 11
CHECK-TRIM-NEXT: !Attributes: 1
CHECK-END-NOT: [
CHECK-MERGE: [_Z5funcBi]:360:32
CHECK-MERGE-NEXT: 0: 32
CHECK-MERGE-NEXT: 1: 32 _Z8funcLeafi:20
CHECK-MERGE-NEXT: 3: 12
CHECK-MERGE-NEXT: !Attributes: 0
CHECK-MERGE-NEXT:[main]:308:12
CHECK-MERGE-NEXT: 2: 24
CHECK-MERGE-NEXT: 3: 28 _Z5funcAi:18
CHECK-MERGE-NEXT: 3.1: 28 _Z5funcBi:30
CHECK-MERGE-NEXT: !Attributes: 0
CHECK-MERGE-NEXT:[_Z5funcAi]:99:11
CHECK-MERGE-NEXT: 0: 10
CHECK-MERGE-NEXT: 1: 10 _Z8funcLeafi:11
CHECK-MERGE-NEXT: 3: 24
CHECK-MERGE-NEXT: !Attributes: 0