CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
82 lines
4.8 KiB
Plaintext
82 lines
4.8 KiB
Plaintext
Tests for weighted merge of instrumented profiles.
|
|
|
|
1- Merge the foo and bar profiles with unity weight and verify the combined output
|
|
RUN: llvm-profdata merge -instr -weighted-input=1,%p/Inputs/weight-instr-bar.profdata -weighted-input=1,%p/Inputs/weight-instr-foo.profdata -o %t
|
|
RUN: llvm-profdata show -instr -all-functions %t > %t.out1
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1 < %t.out1
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2 < %t.out1
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3 < %t.out1
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4 < %t.out1
|
|
RUN: llvm-profdata merge -instr -weighted-input=1,%p/Inputs/weight-instr-bar.profdata %p/Inputs/weight-instr-foo.profdata -o %t
|
|
RUN: llvm-profdata show -instr -all-functions %t > %t.out2
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1 < %t.out2
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2 < %t.out2
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3 < %t.out2
|
|
RUN: FileCheck %s -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4 < %t.out2
|
|
1X_1X_WEIGHT: Counters:
|
|
1X_1X_WEIGHT-1: usage:
|
|
1X_1X_WEIGHT-1: Hash: 0x0000000000000000
|
|
1X_1X_WEIGHT-1: Counters: 1
|
|
1X_1X_WEIGHT-1: Function count: 0
|
|
1X_1X_WEIGHT-2: foo:
|
|
1X_1X_WEIGHT-2: Hash: 0x000000000000028a
|
|
1X_1X_WEIGHT-2: Counters: 3
|
|
1X_1X_WEIGHT-2: Function count: 866988873
|
|
1X_1X_WEIGHT-3: bar:
|
|
1X_1X_WEIGHT-3: Hash: 0x000000000000028a
|
|
1X_1X_WEIGHT-3: Counters: 3
|
|
1X_1X_WEIGHT-3: Function count: 866988873
|
|
1X_1X_WEIGHT-4: main:
|
|
1X_1X_WEIGHT-4: Hash: 0x7d31c47ea98f8248
|
|
1X_1X_WEIGHT-4: Counters: 60
|
|
1X_1X_WEIGHT-4: Function count: 2
|
|
1X_1X_WEIGHT: Functions shown: 4
|
|
1X_1X_WEIGHT-NEXT: Total functions: 4
|
|
1X_1X_WEIGHT-NEXT: Maximum function count: 866988873
|
|
1X_1X_WEIGHT-NEXT: Maximum internal block count: 267914296
|
|
|
|
2- Merge the foo and bar profiles with weight 3x and 5x respectively and verify the combined output
|
|
RUN: llvm-profdata merge -instr -weighted-input=3,%p/Inputs/weight-instr-bar.profdata -weighted-input=5,%p/Inputs/weight-instr-foo.profdata -o %t
|
|
RUN: llvm-profdata show -instr -all-functions %t > %t.out3
|
|
RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-1 < %t.out3
|
|
RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-2 < %t.out3
|
|
RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-3 < %t.out3
|
|
RUN: FileCheck %s -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-4 < %t.out3
|
|
3X_5X_WEIGHT: Counters:
|
|
3X_5X_WEIGHT-1: usage:
|
|
3X_5X_WEIGHT-1: Hash: 0x0000000000000000
|
|
3X_5X_WEIGHT-1: Counters: 1
|
|
3X_5X_WEIGHT-1: Function count: 0
|
|
3X_5X_WEIGHT-2: foo:
|
|
3X_5X_WEIGHT-2: Hash: 0x000000000000028a
|
|
3X_5X_WEIGHT-2: Counters: 3
|
|
3X_5X_WEIGHT-2: Function count: 4334944365
|
|
3X_5X_WEIGHT-3: bar:
|
|
3X_5X_WEIGHT-3: Hash: 0x000000000000028a
|
|
3X_5X_WEIGHT-3: Counters: 3
|
|
3X_5X_WEIGHT-3: Function count: 2600966619
|
|
3X_5X_WEIGHT-4: main:
|
|
3X_5X_WEIGHT-4: Hash: 0x7d31c47ea98f8248
|
|
3X_5X_WEIGHT-4: Counters: 60
|
|
3X_5X_WEIGHT-4: Function count: 8
|
|
3X_5X_WEIGHT: Functions shown: 4
|
|
3X_5X_WEIGHT-NEXT: Total functions: 4
|
|
3X_5X_WEIGHT-NEXT: Maximum function count: 4334944365
|
|
3X_5X_WEIGHT-NEXT: Maximum internal block count: 1339571480
|
|
|
|
3- Bad merge: invalid weight
|
|
RUN: 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_WEIGHT
|
|
RUN: 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_WEIGHT
|
|
RUN: 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_WEIGHT
|
|
RUN: 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_WEIGHT
|
|
RUN: 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_WEIGHT
|
|
INVALID_WEIGHT: error: input weight must be a positive integer
|
|
|
|
4- Bad merge: input path does not exist
|
|
RUN: 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_INPUT
|
|
INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.profdata: [[MSG]]
|
|
|
|
5- No inputs
|
|
RUN: not llvm-profdata merge -instr -o %t.out 2>&1 | FileCheck %s -check-prefix=NO_INPUT
|
|
NO_INPUT: error: no input files specified. See llvm-profdata{{(\.EXE|\.exe)?}} merge -help
|