llvm-project/llvm/test/tools/llvm-profgen/cs-preinline-sample-profile.test
Hongtao Yu 937924eb49 [llvm-profgen] Read sample profiles for post-processing.
Sometimes we would like to run post-processing repeatedly on the original sample profile for tuning. In order to avoid regenerating the original profile from scratch every time, this change adds the support of reading in the original profile (called symbolized profile) and running the post-processor on it.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D121655
2022-03-30 13:51:16 -07:00

44 lines
2.2 KiB
Plaintext

; Test default llvm-profgen with preinline off
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=0 --gen-cs-nested-profile=0 --output=%t1
; Test llvm-profgen with preinliner on will merge not inlinable profile into base profile.
; RUN: llvm-profgen --format=text --llvm-sample-profile=%t1 --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --gen-cs-nested-profile=0 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t2
; RUN: FileCheck %s --input-file %t2 --check-prefix=CHECK-PREINL
; Test default llvm-profgen with preinline off
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --csspgo-preinliner=0 --gen-cs-nested-profile=0 --output=%t3
; Test llvm-profgen with preinliner on will merge not inlinable profile into base profile.
; RUN: llvm-profgen --format=text --llvm-sample-profile=%t3 --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --csspgo-preinliner=1 --gen-cs-nested-profile=0 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t4
; RUN: FileCheck %s --input-file %t4 --check-prefix=CHECK-PREINL-PROBE
; CHECK-PREINL: [foo]:309:0
; CHECK-PREINL-NEXT: 2.1: 14
; CHECK-PREINL-NEXT: 3: 15
; CHECK-PREINL-NEXT: 3.1: 14 bar:14
; CHECK-PREINL-NEXT: 3.2: 1
; CHECK-PREINL-NEXT: 65526: 14
; CHECK-PREINL-NEXT: !Attributes: 1
; CHECK-PREINL-NEXT:[foo:3.1 @ bar]:84:0
; CHECK-PREINL-NEXT: 1: 14
; CHECK-PREINL-NEXT: !Attributes: 3
; CHECK-PREINL-PROBE: [foo]:74:0
; CHECK-PREINL-PROBE-NEXT: 1: 0
; CHECK-PREINL-PROBE-NEXT: 2: 15
; CHECK-PREINL-PROBE-NEXT: 3: 15
; CHECK-PREINL-PROBE-NEXT: 4: 14
; CHECK-PREINL-PROBE-NEXT: 5: 1
; CHECK-PREINL-PROBE-NEXT: 6: 15
; CHECK-PREINL-PROBE-NEXT: 7: 0
; CHECK-PREINL-PROBE-NEXT: 8: 14 bar:14
; CHECK-PREINL-PROBE-NEXT: 9: 0
; CHECK-PREINL-PROBE-NEXT: !CFGChecksum: 563088904013236
; CHECK-PREINL-PROBE-NEXT: !Attributes: 1
; CHECK-PREINL-PROBE-NEXT:[foo:8 @ bar]:28:14
; CHECK-PREINL-PROBE-NEXT: 1: 14
; CHECK-PREINL-PROBE-NEXT: 4: 14
; CHECK-PREINL-PROBE-NEXT: !CFGChecksum: 72617220756
; CHECK-PREINL-PROBE-NEXT: !Attributes: 3