brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · 3f6979a Raw
82 lines · plain
1Tests for weighted merge of instrumented profiles.2 31- Merge the foo and bar profiles with unity weight and verify the combined output4RUN: llvm-profdata merge -instr -weighted-input=1,%p/Inputs/weight-instr-bar.profdata -weighted-input=1,%p/Inputs/weight-instr-foo.profdata -o %t5RUN: llvm-profdata show -instr -all-functions %t > %t.out16RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1 < %t.out17RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2 < %t.out18RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3 < %t.out19RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4 < %t.out110RUN: llvm-profdata merge -instr -weighted-input=1,%p/Inputs/weight-instr-bar.profdata %p/Inputs/weight-instr-foo.profdata -o %t11RUN: llvm-profdata show -instr -all-functions %t > %t.out212RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1 < %t.out213RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2 < %t.out214RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3 < %t.out215RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4 < %t.out2161X_1X_WEIGHT: Counters:171X_1X_WEIGHT-1:   usage:181X_1X_WEIGHT-1:     Hash: 0x0000000000000000191X_1X_WEIGHT-1:     Counters: 1201X_1X_WEIGHT-1:     Function count: 0211X_1X_WEIGHT-2:   foo:221X_1X_WEIGHT-2:     Hash: 0x000000000000028a231X_1X_WEIGHT-2:     Counters: 3241X_1X_WEIGHT-2:     Function count: 866988873251X_1X_WEIGHT-3:   bar:261X_1X_WEIGHT-3:     Hash: 0x000000000000028a271X_1X_WEIGHT-3:     Counters: 3281X_1X_WEIGHT-3:     Function count: 866988873291X_1X_WEIGHT-4:   main:301X_1X_WEIGHT-4:     Hash: 0x7d31c47ea98f8248311X_1X_WEIGHT-4:     Counters: 60321X_1X_WEIGHT-4:     Function count: 2331X_1X_WEIGHT:      Functions shown: 4341X_1X_WEIGHT-NEXT: Total functions: 4351X_1X_WEIGHT-NEXT: Maximum function count: 866988873361X_1X_WEIGHT-NEXT: Maximum internal block count: 26791429637 382- Merge the foo and bar profiles with weight 3x and 5x respectively and verify the combined output39RUN: llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=5,%p/Inputs/weight-instr-foo.profdata -o %t40RUN: llvm-profdata show -instr -all-functions %t > %t.out341RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-1 < %t.out342RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-2 < %t.out343RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-3 < %t.out344RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-4 < %t.out3453X_5X_WEIGHT: Counters:463X_5X_WEIGHT-1:   usage:473X_5X_WEIGHT-1:     Hash: 0x0000000000000000483X_5X_WEIGHT-1:     Counters: 1493X_5X_WEIGHT-1:     Function count: 0503X_5X_WEIGHT-2:   foo:513X_5X_WEIGHT-2:     Hash: 0x000000000000028a523X_5X_WEIGHT-2:     Counters: 3533X_5X_WEIGHT-2:     Function count: 4334944365543X_5X_WEIGHT-3:   bar:553X_5X_WEIGHT-3:     Hash: 0x000000000000028a563X_5X_WEIGHT-3:     Counters: 3573X_5X_WEIGHT-3:     Function count: 2600966619583X_5X_WEIGHT-4:   main:593X_5X_WEIGHT-4:     Hash: 0x7d31c47ea98f8248603X_5X_WEIGHT-4:     Counters: 60613X_5X_WEIGHT-4:     Function count: 8623X_5X_WEIGHT:      Functions shown: 4633X_5X_WEIGHT-NEXT: Total functions: 4643X_5X_WEIGHT-NEXT: Maximum function count: 4334944365653X_5X_WEIGHT-NEXT: Maximum internal block count: 133957148066 673- Bad merge: invalid weight68RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=0,%p/Inputs/weight-instr-foo.profdata -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT69RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=0.75,%p/Inputs/weight-instr-foo.profdata -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT70RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=-5,%p/Inputs/weight-instr-foo.profdata -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT71RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=,%p/Inputs/weight-instr-foo.profdata -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT72RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=%p/Inputs/weight-instr-foo.profdata -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT73INVALID_WEIGHT: error: input weight must be a positive integer74 754- Bad merge: input path does not exist76RUN: not llvm-profdata merge -instr -weighted-input=3,%p/Inputs/does-not-exist.profdata -weighted-input=2,%p/Inputs/does-not-exist-either.profdata -o %t.out 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=INVALID_INPUT77INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.profdata: [[MSG]]78 795- No inputs80RUN: not llvm-profdata merge -instr -o %t.out 2>&1 | FileCheck %s -check-prefix=NO_INPUT81NO_INPUT: error: no input files specified. See llvm-profdata{{(\.EXE|\.exe)?}} merge -help82