1 ; Used the data from recursion-compression.test, refer it for the unmerged output
2 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/recursion-compression-pseudoprobe.perfscript --binary=%S/Inputs/recursion-compression-pseudoprobe.perfbin --output=%t1 --compress-recursion=-1 --profile-summary-hot-count=8 --csspgo-preinliner=0 --gen-cs-nested-profile=0
3 ; RUN: FileCheck %s --input-file %t1
5 ; Test --trim-cold-profile=0
6 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/recursion-compression-pseudoprobe.perfscript --binary=%S/Inputs/recursion-compression-pseudoprobe.perfbin --output=%t2 --compress-recursion=-1 --profile-summary-hot-count=100 --trim-cold-profile=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0
7 ; RUN: FileCheck %s --input-file %t2 --check-prefix=CHECK-KEEP-COLD
9 ; Test --csprof-merge-cold-context=0
10 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/recursion-compression-pseudoprobe.perfscript --binary=%S/Inputs/recursion-compression-pseudoprobe.perfbin --output=%t3 --compress-recursion=-1 --profile-summary-hot-count=10 --csprof-merge-cold-context=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0
11 ; RUN: FileCheck %s --input-file %t3 --check-prefix=CHECK-UNMERGED
13 ; Test --csprof-frame-depth-for-cold-context
14 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/recursion-compression-pseudoprobe.perfscript --binary=%S/Inputs/recursion-compression-pseudoprobe.perfbin --output=%t2 --compress-recursion=-1 --profile-summary-hot-count=100 --trim-cold-profile=0 --csprof-max-cold-context-depth=2 --csspgo-preinliner=0 --gen-cs-nested-profile=0
15 ; RUN: FileCheck %s --input-file %t2 --check-prefix=CHECK-COLD-CONTEXT-LENGTH
23 ; CHECK-NEXT: 7: 2 fb:2
24 ; CHECK-NEXT: 8: 1 fa:1
25 ; CHECK-NEXT: !CFGChecksum: 563070469352221
26 ; CHECK-NEXT:[main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb]:13:4
31 ; CHECK-NEXT: 5: 4 fb:4
32 ; CHECK-NEXT: 6: 1 fa:1
33 ; CHECK-NEXT: !CFGChecksum: 563022570642068
35 ; CHECK-KEEP-COLD: [fb]:19:6
36 ; CHECK-KEEP-COLD-NEXT: 1: 6
37 ; CHECK-KEEP-COLD-NEXT: 2: 3
38 ; CHECK-KEEP-COLD-NEXT: 3: 3
39 ; CHECK-KEEP-COLD-NEXT: 4: 0
40 ; CHECK-KEEP-COLD-NEXT: 5: 4 fb:4
41 ; CHECK-KEEP-COLD-NEXT: 6: 3 fa:3
42 ; CHECK-KEEP-COLD-NEXT: !CFGChecksum: 563022570642068
43 ; CHECK-KEEP-COLD-NEXT:[fa]:14:4
44 ; CHECK-KEEP-COLD-NEXT: 1: 4
45 ; CHECK-KEEP-COLD-NEXT: 3: 4
46 ; CHECK-KEEP-COLD-NEXT: 4: 2
47 ; CHECK-KEEP-COLD-NEXT: 5: 1
48 ; CHECK-KEEP-COLD-NEXT: 6: 0
49 ; CHECK-KEEP-COLD-NEXT: 7: 2 fb:2
50 ; CHECK-KEEP-COLD-NEXT: 8: 1 fa:1
51 ; CHECK-KEEP-COLD-NEXT: !CFGChecksum: 563070469352221
53 ; CHECK-UNMERGED: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb]:13:4
54 ; CHECK-UNMERGED-NEXT: 1: 4
55 ; CHECK-UNMERGED-NEXT: 2: 3
56 ; CHECK-UNMERGED-NEXT: 3: 1
57 ; CHECK-UNMERGED-NEXT: 4: 0
58 ; CHECK-UNMERGED-NEXT: 5: 4 fb:4
59 ; CHECK-UNMERGED-NEXT: 6: 1 fa:1
60 ; CHECK-UNMERGED-NEXT: !CFGChecksum: 563022570642068
61 ; CHECK-UNMERGED-NOT: [fa]
62 ; CHECK-UNMERGED-NOT: [fb]
64 ; CHECK-COLD-CONTEXT-LENGTH: [fb:5 @ fb]:13:4
65 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 4
66 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 2: 3
67 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 3: 1
68 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 4: 0
69 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 5: 4 fb:4
70 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 1 fa:1
71 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563022570642068
72 ; CHECK-COLD-CONTEXT-LENGTH-NEXT:[fb:6 @ fa]:10:3
73 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 3
74 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 3: 3
75 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 4: 1
76 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 5: 1
77 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 0
78 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 7: 1 fb:1
79 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 8: 1 fa:1
80 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563070469352221
81 ; CHECK-COLD-CONTEXT-LENGTH-NEXT:[fa:7 @ fb]:6:2
82 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 2
83 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 2: 0
84 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 3: 2
85 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 4: 0
86 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 5: 0
87 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 2 fa:2
88 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563022570642068
89 ; CHECK-COLD-CONTEXT-LENGTH-NEXT:[fa:8 @ fa]:4:1
90 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 1
91 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 3: 1
92 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 4: 1
93 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 5: 0
94 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 0
95 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 7: 1 fb:1
96 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 8: 0
97 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563070469352221
99 ; clang -O3 -fuse-ld=lld -fpseudo-probe-for-profiling
100 ; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Xclang -mdisable-tail-calls
103 ; Copied from recursion-compression.test
107 if(n > 10) return fb(n / 2);
113 if(n % 2) return fb(n - 1);
121 printf("sum is %d\n", s);