mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
7fbb587058
As a follow-up to https://reviews.llvm.org/D104129, I'm cleaning up the danling probe related code in both the compiler and llvm-profgen. I'm seeing a 5% size win for the pseudo_probe section for SPEC2017 and 10% for Ciner. Certain benchmark such as 602.gcc has a 20% size win. No obvious difference seen on build time for SPEC2017 and Cinder. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D104477
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --show-unwinder-output --profile-summary-cold-count=0 | FileCheck %s --check-prefix=CHECK-UNWINDER
|
|
; RUN: FileCheck %s --input-file %t
|
|
|
|
; CHECK: [main:2 @ foo]:74:0
|
|
; CHECK-NEXT: 1: 0
|
|
; CHECK-NEXT: 2: 15
|
|
; CHECK-NEXT: 3: 15
|
|
; CHECK-NEXT: 4: 14
|
|
; CHECK-NEXT: 5: 1
|
|
; CHECK-NEXT: 6: 15
|
|
; CHECK-NEXT: 7: 0
|
|
; CHECK-NEXT: 8: 14 bar:14
|
|
; CHECK-NEXT: 9: 0
|
|
; CHECK-NEXT: !CFGChecksum: 563088904013236
|
|
; CHECK:[main:2 @ foo:8 @ bar]:28:14
|
|
; CHECK-NEXT: 1: 14
|
|
; CHECK-NEXT: 4: 14
|
|
; CHECK-NEXT: !CFGChecksum: 72617220756
|
|
|
|
|
|
; CHECK-UNWINDER: Binary(inline-cs-pseudoprobe.perfbin)'s Range Counter:
|
|
; CHECK-UNWINDER-EMPTY:
|
|
; CHECK-UNWINDER-NEXT: (800, 858): 1
|
|
; CHECK-UNWINDER-NEXT: (80e, 82b): 1
|
|
; CHECK-UNWINDER-NEXT: (80e, 858): 13
|
|
|
|
; CHECK-UNWINDER: Binary(inline-cs-pseudoprobe.perfbin)'s Branch Counter:
|
|
; CHECK-UNWINDER-EMPTY:
|
|
; CHECK-UNWINDER-NEXT: (82b, 800): 1
|
|
; CHECK-UNWINDER-NEXT: (858, 80e): 15
|
|
|
|
; clang -O3 -fexperimental-new-pass-manager -fuse-ld=lld -fpseudo-probe-for-profiling
|
|
; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Xclang -mdisable-tail-calls
|
|
; -g test.c -o a.out
|
|
|
|
#include <stdio.h>
|
|
|
|
int bar(int x, int y) {
|
|
if (x % 3) {
|
|
return x - y;
|
|
}
|
|
return x + y;
|
|
}
|
|
|
|
void foo() {
|
|
int s, i = 0;
|
|
while (i++ < 4000 * 4000)
|
|
if (i % 91) s = bar(i, s); else s += 30;
|
|
printf("sum is %d\n", s);
|
|
}
|
|
|
|
int main() {
|
|
foo();
|
|
return 0;
|
|
}
|