forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I62253aef67ed81152eee6b0537053e3675399458
- Loading branch information
Showing
187 changed files
with
3,980 additions
and
2,261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
header: | ||
profile-version: 1 | ||
binary-name: 'reader-yaml.test.tmp.exe' | ||
binary-build-id: '<unknown>' | ||
profile-flags: [ lbr ] | ||
profile-origin: branch profile reader | ||
profile-events: '' | ||
dfs-order: false | ||
functions: | ||
- name: SolveCubic | ||
fid: 6 | ||
hash: 0xC6E9098E973BBE19 | ||
exec: 151 | ||
nblocks: 18 | ||
blocks: | ||
- bid: 0 | ||
insns: 43 | ||
hash: 0xed4db287e71c0000 | ||
exec: 151 | ||
succ: [ { bid: 1, cnt: 151, mis: 2 }, { bid: 7, cnt: 0 } ] | ||
- bid: 1 | ||
insns: 7 | ||
hash: 0x39330000e4560088 | ||
succ: [ { bid: 13, cnt: 151 }, { bid: 2, cnt: 0 } ] | ||
- bid: 13 | ||
insns: 26 | ||
hash: 0xa9700000fe202a7 | ||
succ: [ { bid: 3, cnt: 89 }, { bid: 2, cnt: 10 } ] | ||
- bid: 3 | ||
insns: 9 | ||
hash: 0x62391dad18a700a0 | ||
succ: [ { bid: 5, cnt: 151 } ] | ||
- bid: 5 | ||
insns: 9 | ||
hash: 0x4d906d19ecec0111 | ||
- name: usqrt | ||
fid: 7 | ||
hash: 0x8B62B1F9AD81EA35 | ||
exec: 20 | ||
nblocks: 6 | ||
blocks: | ||
- bid: 0 | ||
insns: 4 | ||
hash: 0x1111111111111111 | ||
exec: 20 | ||
succ: [ { bid: 1, cnt: 0 } ] | ||
- bid: 1 | ||
insns: 9 | ||
hash: 0x27e43a5e10cd0010 | ||
succ: [ { bid: 3, cnt: 320, mis: 171 }, { bid: 2, cnt: 0 } ] | ||
- bid: 3 | ||
insns: 2 | ||
hash: 0x4db935b6471e0039 | ||
succ: [ { bid: 1, cnt: 300, mis: 33 }, { bid: 4, cnt: 20 } ] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This script checks that YamlProfileReader in llvm-bolt is reading data | ||
# correctly and stale data is corrected by profile inference. | ||
|
||
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe | ||
RUN: llvm-bolt %t.exe -o %t.null -b %p/Inputs/blarge_profile_stale.std-hash.yaml \ | ||
RUN: --print-cfg --print-only=usqrt,SolveCubic --infer-stale-profile=1 -v=1 \ | ||
RUN: 2>&1 | FileCheck %s | ||
|
||
# Verify that yaml reader works as expected. | ||
CHECK: pre-processing profile using YAML profile reader | ||
CHECK: BOLT-INFO: YAML profile with hash: std::hash | ||
|
||
# Function "SolveCubic" has stale profile, since there is one jump in the | ||
# profile (from bid=13 to bid=2) which is not in the CFG in the binary. The test | ||
# verifies that the inference is able to match two blocks (bid=1 and bid=13) | ||
# using "loose" hashes and then correctly propagate the counts. | ||
|
||
CHECK: Binary Function "SolveCubic" after building cfg { | ||
CHECK: State : CFG constructed | ||
CHECK: Address : 0x400e00 | ||
CHECK: Size : 0x368 | ||
CHECK: Section : .text | ||
CHECK: IsSimple : 1 | ||
CHECK: BB Count : 18 | ||
CHECK: Exec Count : 151 | ||
CHECK: Branch Count: 552 | ||
CHECK: } | ||
# Verify block counts. | ||
CHECK: .LBB00 (43 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB07:]] (mispreds: 0, count: 0), .LFT[[#BB01:]] (mispreds: 0, count: 151) | ||
CHECK: .LFT[[#BB01:]] (5 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB013:]] (mispreds: 0, count: 151), .LFT[[#BB02:]] (mispreds: 0, count: 0) | ||
CHECK: .Ltmp[[#BB03:]] (26 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB05:]] (mispreds: 0, count: 151), .LFT[[#BB04:]] (mispreds: 0, count: 0) | ||
CHECK: .Ltmp[[#BB05:]] (9 instructions, align : 1) | ||
CHECK: .Ltmp[[#BB013:]] (12 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB03:]] (mispreds: 0, count: 151) | ||
CHECK: End of Function "SolveCubic" | ||
|
||
# Function "usqrt" has stale profile, since the number of blocks in the profile | ||
# (nblocks=6) does not match the size of the CFG in the binary. The entry | ||
# block (bid=0) has an incorrect (missing) count, which should be inferred by | ||
# the algorithm. | ||
|
||
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[[#BB113:]] (mispreds: 0, count: 20) | ||
CHECK: .Ltmp[[#BB113:]] (9 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB112:]] (mispreds: 0, count: 320), .LFT[[#BB10:]] (mispreds: 0, count: 0) | ||
CHECK: .LFT[[#BB10:]] (2 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB112:]] (mispreds: 0, count: 0) | ||
CHECK: .Ltmp[[#BB112:]] (2 instructions, align : 1) | ||
CHECK: Successors: .Ltmp[[#BB113:]] (mispreds: 0, count: 300), .LFT[[#BB11:]] (mispreds: 0, count: 20) | ||
CHECK: .LFT[[#BB11:]] (2 instructions, align : 1) | ||
CHECK: End of Function "usqrt" | ||
# Check the overall inference stats. | ||
CHECK: 2 out of 7 functions in the binary (28.6%) have non-empty execution profile | ||
CHECK: inferred profile for 2 (100.00% of profiled, 100.00% of stale) functions responsible for {{.*}} samples ({{.*}} out of {{.*}}) |
Oops, something went wrong.