-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[SHT_LLVM_BB_ADDR] Implement ELF and YAML support for Propeller CFG data in PGO analysis map. #164914
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
Merged
[SHT_LLVM_BB_ADDR] Implement ELF and YAML support for Propeller CFG data in PGO analysis map. #164914
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4607f03
Add Propeller cfg fields to ELFTypes.h
rlavaee a0f61cb
Add some changes in ELFYAML
rlavaee f367d59
More changes in YAML.
rlavaee 3068d13
Add yaml2obj test.
rlavaee 2c84241
Add obj2yaml support and test.
rlavaee 2ef8082
Fix conflict.
rlavaee 71604d3
clang-format.
rlavaee a2347af
Add unit test.
rlavaee 989b55e
clang-format.
rlavaee a5e3564
Merge branch 'main' into propeller-cfg-decode
rlavaee 4f9aee7
Improve comment for Propeller data.
rlavaee ceb304f
Rename Propeller to PostLink.
rlavaee 9b92076
clang-format.
rlavaee 3832bf9
Change comment to mention bolt and propeller as examples of post link…
rlavaee ffd870c
Add primitive type default initializations.
rlavaee c113f78
Bump feature value to a 16byte value.
rlavaee 028c3cb
Add a test for unsupported features.
rlavaee 8a0a020
Final nits.
rlavaee 7e7ab00
Merge branch 'main' into propeller-cfg-decode
rlavaee 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
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
40 changes: 40 additions & 0 deletions
40
llvm/test/tools/llvm-readobj/ELF/bb-addr-map-feature-warning.test
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,40 @@ | ||
| ## This test checks that we output a warning when the specified version is too old to support the given features. | ||
|
|
||
| # RUN: yaml2obj %s -o %t | ||
| # RUN: llvm-readobj --bb-addr-map %t 2>&1 | FileCheck -DFILE=%t %s | ||
|
|
||
| --- !ELF | ||
| FileHeader: | ||
| Class: ELFCLASS64 | ||
| Data: ELFDATA2LSB | ||
| Type: ET_EXEC | ||
|
|
||
|
|
||
|
||
| # CHECK: BBAddrMap [ | ||
| # CHECK-NEXT: warning: '[[FILE]]': unable to dump SHT_LLVM_BB_ADDR_MAP section with index 1: version should be >= 3 for SHT_LLVM_BB_ADDR_MAP when callsite offsets feature is enabled: version = 2 feature = 32 | ||
| Sections: | ||
| - Name: '.llvm_bb_addr_map (1)' | ||
| Type: SHT_LLVM_BB_ADDR_MAP | ||
| Entries: | ||
| - Version: 2 | ||
| Feature: 0x20 | ||
|
|
||
|
|
||
|
|
||
| # CHECK: BBAddrMap [ | ||
| # CHECK-NEXT: warning: '[[FILE]]': unable to dump SHT_LLVM_BB_ADDR_MAP section with index 2: version should be >= 4 for SHT_LLVM_BB_ADDR_MAP when basic block hash feature is enabled: version = 3 feature = 64 | ||
|
|
||
| - Name: '.llvm_bb_addr_map (2)' | ||
| Type: SHT_LLVM_BB_ADDR_MAP | ||
| Entries: | ||
| - Version: 3 | ||
| Feature: 0x40 | ||
|
|
||
| # CHECK: BBAddrMap [ | ||
| # CHECK-NEXT: warning: '[[FILE]]': unable to dump SHT_LLVM_BB_ADDR_MAP section with index 3: version should be >= 5 for SHT_LLVM_BB_ADDR_MAP when post link cfg feature is enabled: version = 4 feature = 128 | ||
|
|
||
| - Name: '.llvm_bb_addr_map (3)' | ||
| Type: SHT_LLVM_BB_ADDR_MAP | ||
| Entries: | ||
| - Version: 4 | ||
| Feature: 0x80 | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth changing these to
uint16_tat the same time, or risk a copy/paste issue when the next feature is introduced.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done