-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[BOLT] Match functions with name similarity #95884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
shawbyoung
merged 39 commits into
main
from
users/shawbyoung/spr/bolt-name-similarity-function-matching
Jul 3, 2024
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
fab60ab
[𝘀𝗽𝗿] changes to main this commit is based on
sayhaan 7ac4c1a
[𝘀𝗽𝗿] initial version
shawbyoung 0a5a829
[𝘀𝗽𝗿] changes introduced through rebase
shawbyoung 190949c
spr amend
shawbyoung 34652b2
spr amend
shawbyoung 2d23bbd
spr amend
shawbyoung 9e6bb26
spr amend
shawbyoung ff561cb
[𝘀𝗽𝗿] changes introduced through rebase
shawbyoung 58993f9
spr amend
shawbyoung 669afca
spr amend
shawbyoung 9c021f8
spr amend
shawbyoung 9fc1899
spr amend
shawbyoung d687bc0
Added test
shawbyoung bba68e6
[𝘀𝗽𝗿] changes introduced through rebase
maksfb 2d99875
Changed DeriveNameSpace argument
shawbyoung 550d6ac
[𝘀𝗽𝗿] changes introduced through rebase
maksfb be21785
spr diff --update-message
shawbyoung 5493cd4
[𝘀𝗽𝗿] changes introduced through rebase
maksfb 0ddd72b
Refactored DeriveNamespace and expanded flag description
shawbyoung 5d3e8db
[𝘀𝗽𝗿] changes introduced through rebase
maksfb 0eeeeb6
Removed tmp file
shawbyoung 85c74bd
[𝘀𝗽𝗿] changes introduced through rebase
maksfb 5da6a09
Small optimization
shawbyoung c40b612
[𝘀𝗽𝗿] changes introduced through rebase
maksfb e9974a9
Refactored into function
shawbyoung 3885a7f
[𝘀𝗽𝗿] changes introduced through rebase
maksfb d00d613
Changed verbosity
shawbyoung 60d7d92
[𝘀𝗽𝗿] changes introduced through rebase
maksfb c65bce0
Formatting
shawbyoung 4c63f17
[𝘀𝗽𝗿] changes introduced through rebase
maksfb 873afb2
Using BufferSize from getContextDeclCxtName
shawbyoung d61c640
[𝘀𝗽𝗿] changes introduced through rebase
maksfb a801ff3
Comments
shawbyoung 32cce08
[𝘀𝗽𝗿] changes introduced through rebase
aaupov 1dab537
Rebase
shawbyoung 60047ab
Changing buffer initialization in DeriveNamespace
shawbyoung df20265
[𝘀𝗽𝗿] changes introduced through rebase
aaupov 2e0eae4
Rebase
shawbyoung 39a6901
Rebase
shawbyoung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,63 @@ | ||
## Tests function matching in YAMLProfileReader by name similarity. | ||
|
||
# REQUIRES: system-linux | ||
# RUN: split-file %s %t | ||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o | ||
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib | ||
# RUN: llvm-bolt %t.exe -o %t.out --data %t/yaml -v=2 \ | ||
# RUN: --print-cfg --name-similarity-function-matching-threshold=1 --funcs=main --profile-ignore-hash=0 2>&1 | FileCheck %s | ||
|
||
# CHECK: BOLT-INFO: matched 1 functions with similar names | ||
|
||
#--- main.s | ||
.globl main | ||
.type main, @function | ||
main: | ||
.cfi_startproc | ||
.LBB00: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
subq $16, %rsp | ||
testq %rax, %rax | ||
js .LBB03 | ||
.LBB01: | ||
jne .LBB04 | ||
.LBB02: | ||
nop | ||
.LBB03: | ||
xorl %eax, %eax | ||
addq $16, %rsp | ||
popq %rbp | ||
retq | ||
.LBB04: | ||
xorl %eax, %eax | ||
addq $16, %rsp | ||
popq %rbp | ||
retq | ||
## For relocations against .text | ||
.reloc 0, R_X86_64_NONE | ||
.cfi_endproc | ||
.size main, .-main | ||
|
||
#--- yaml | ||
--- | ||
header: | ||
profile-version: 1 | ||
binary-name: 'hashing-based-function-matching.s.tmp.exe' | ||
binary-build-id: '<unknown>' | ||
profile-flags: [ lbr ] | ||
profile-origin: branch profile reader | ||
profile-events: '' | ||
dfs-order: false | ||
hash-func: xxh3 | ||
functions: | ||
- name: main2 | ||
fid: 0 | ||
hash: 0x0000000000000001 | ||
exec: 1 | ||
nblocks: 5 | ||
blocks: | ||
- bid: 1 | ||
insns: 1 | ||
succ: [ { bid: 3, cnt: 1} ] | ||
... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.