File: reader-stale-yaml.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (39 lines) | stat: -rw-r--r-- 1,876 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This script checks that YamlProfileReader in llvm-bolt is reading data
# correctly and stale data is corrected.

RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
RUN: llvm-bolt %t.exe -o /dev/null --b %p/Inputs/blarge_profile_stale.yaml \
RUN:   --print-cfg --print-only=usqrt --infer-stale-profile=1 \
RUN:   --profile-ignore-hash=1 --profile-use-dfs 2>&1 | FileCheck %s

# Verify that yaml reader works as expected.
CHECK:  pre-processing profile using YAML profile reader

# Verify the inferred counts of "usqrt" that has stale profile:
#   - the function has nblocks=6 in the profile, which makes it stale
#   - block with bid=0 has an incorrect (missing) count, which is inferred
CHECK:    Binary Function "usqrt" after building cfg {
CHECK:      State       : CFG constructed
CHECK:      Address     : 0x401170
CHECK:      Size        : 0x43
CHECK:      Section     : .text
CHECK:      IsSimple    : 1
CHECK:      BB Count    : 5
CHECK:      Exec Count  : 20
CHECK:      Branch Count: 640
CHECK:    }

# Verify block counts.
CHECK:    .LBB01 (4 instructions, align : 1)
CHECK:      Successors: .Ltmp[[#BB13:]] (mispreds: 0, count: 20)
CHECK:    .Ltmp[[#BB13:]] (9 instructions, align : 1)
CHECK:      Successors: .Ltmp[[#BB12:]] (mispreds: 0, count: 320), .LFT[[#BB0:]] (mispreds: 0, count: 0)
CHECK:    .LFT[[#BB0:]] (2 instructions, align : 1)
CHECK:      Successors: .Ltmp[[#BB12:]] (mispreds: 0, count: 0)
CHECK:    .Ltmp[[#BB12:]] (2 instructions, align : 1)
CHECK:      Successors: .Ltmp[[#BB13:]] (mispreds: 0, count: 300), .LFT[[#BB1:]] (mispreds: 0, count: 20)
CHECK:    .LFT[[#BB1:]] (2 instructions, align : 1)

# Check the overal inference stats.
CHECK:  2 out of 7 functions in the binary (28.6%) have non-empty execution profile
CHECK:  inferred profile for 1 (50.00% of profiled, 100.00% of stale) functions responsible for 87.31% samples (640 out of 733)