2 ; Test default using size of profile as a proxy
3 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/cs-preinline-cost.perfscript --binary=%S/Inputs/cs-preinline-cost.perfbin --csspgo-preinliner --debug-only=cs-preinliner --use-context-cost-for-preinliner=0 --output=/dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT
5 ; Test use-context-cost-for-preinliner using inlinee's byte size as context-sensitive inline cost
6 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/cs-preinline-cost.perfscript --binary=%S/Inputs/cs-preinline-cost.perfbin --csspgo-preinliner --debug-only=cs-preinliner --use-context-cost-for-preinliner --output=/dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-CSCOST
8 CHECK-DEFAULT: Process main for context-sensitive pre-inlining (pre-inline size: 9, size limit: 108)
9 CHECK-DEFAULT-NEXT: Inlined context profile for: main:9 @ _Z3fooi (callee size: 2, call count:545)
10 CHECK-DEFAULT-NEXT: Inlined context profile for: main:7 @ _Z3fooi (callee size: 14, call count:545)
11 CHECK-DEFAULT-NEXT: Inlined context profile for: main:8 @ _Z3fooi (callee size: 4, call count:544)
13 CHECK-CSCOST: Process main for context-sensitive pre-inlining (pre-inline size: 69, size limit: 828)
14 ; This inlinee is fully optimized away, make sure we have the correct zero size for that context even if the size is
15 ; not available through symbolization.
16 CHECK-CSCOST-NEXT: Inlined context profile for: main:9 @ _Z3fooi (callee size: 0, call count:545)
17 CHECK-CSCOST-NEXT: Inlined context profile for: main:7 @ _Z3fooi (callee size: 279, call count:545)
18 CHECK-CSCOST-NEXT: Inlined context profile for: main:8 @ _Z3fooi (callee size: 44, call count:544)
20 ; binary is built with the source below using the following command line:
21 ; clang -O3 -g -fpseudo-probe-for-profiling test.cpp
25 ;volatile int state = 9000;
38 ; while (state > 5000) {
39 ; for (int i = 50; i >= 0; i--) {
47 ; while (state < 5000) {
48 ; for (int i = 50; i >= 0; i--) {
59 ;volatile int cnt = 10000000;//10000000;
62 ; for (int i = 0; i < cnt; i++) {