mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +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
53 lines
2.0 KiB
Plaintext
53 lines
2.0 KiB
Plaintext
; Test unique linkage name decoding and canonicalization from dwarf debug info
|
|
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/unique-linkage-name-dwarf.perfscript --binary=%S/Inputs/unique-linkage-name-dwarf.perfbin --output=%t --profile-summary-cold-count=0
|
|
; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-DWARF-FNAME
|
|
|
|
; CHECK-DWARF-FNAME:[main:1 @ foo]:309:0
|
|
; CHECK-DWARF-FNAME: 2: 14
|
|
; CHECK-DWARF-FNAME: 3: 29 bar.__uniq.26267048767521081047744692097241227776:14
|
|
; CHECK-DWARF-FNAME:[main:1 @ foo:3 @ bar.__uniq.26267048767521081047744692097241227776]:84:0
|
|
; CHECK-DWARF-FNAME: 1: 14
|
|
|
|
|
|
; Test unique linkage name decoding and canonicalization from pseudo probe info
|
|
; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/unique-linkage-name-probe.perfscript --binary=%S/Inputs/unique-linkage-name-probe.perfbin --output=%t --profile-summary-cold-count=0
|
|
; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-PROBE-FNAME
|
|
|
|
; CHECK-PROBE-FNAME:[main:2 @ foo]:75:0
|
|
; CHECK-PROBE-FNAME: 2: 15
|
|
; CHECK-PROBE-FNAME: 3: 15
|
|
; CHECK-PROBE-FNAME: 4: 15
|
|
; CHECK-PROBE-FNAME: 6: 15
|
|
; CHECK-PROBE-FNAME: 8: 15 _ZL3barii.__uniq.276699478366846449772231447066107882794:15
|
|
; CHECK-PROBE-FNAME: !CFGChecksum: 563088904013236
|
|
; CHECK-PROBE-FNAME:[main:2 @ foo:8 @ _ZL3barii.__uniq.276699478366846449772231447066107882794]:30:15
|
|
; CHECK-PROBE-FNAME: 1: 15
|
|
; CHECK-PROBE-FNAME: 4: 15
|
|
; CHECK-PROBE-FNAME: !CFGChecksum: 72617220756
|
|
|
|
|
|
; Original code:
|
|
; Dwarf: clang -O3 -funique-internal-linkage-names -g test.c -o a.out
|
|
; Probe: clang -O3 -funique-internal-linkage-names -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>
|
|
|
|
static 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;
|
|
}
|