-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[SHT_LLVM_BB_ADDR_MAP] Adds pretty printing of BFI and BPI for PGO Analysis Map in tools. #82292
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
Changes from 5 commits
e81270d
61891cf
35dbac7
876fc88
dc89247
6aa1e45
897fd37
ab933d5
e308a7a
d1ae461
b6cd9c4
6a01ee3
88d37aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,14 @@ | |
|
||
## Check 64-bit: | ||
# RUN: yaml2obj %s -DBITS=64 -DADDR=0x999999999 -o %t1.x64.o | ||
# RUN: llvm-readobj %t1.x64.o --bb-addr-map 2>&1 | FileCheck %s -DADDR=0x999999999 -DFILE=%t1.x64.o --check-prefix=CHECK | ||
# RUN: llvm-readobj %t1.x64.o --bb-addr-map 2>&1 | FileCheck %s -DADDR=0x999999999 -DFILE=%t1.x64.o --check-prefixes=CHECK,RAW | ||
# RUN: llvm-readobj %t1.x64.o --bb-addr-map --pretty-pgo-analysis-map 2>&1 | FileCheck %s -DADDR=0x999999999 -DFILE=%t1.x64.o --check-prefixes=CHECK,PRETTY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same coomment as above re. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For readobj, full line matching and strict whitespace is less needed since the structure formatting is done by ScopedPrinters, rather than manual like objdump. The braces and bracket are good enough to validate the fields are printed in the right spot and then trust the spacing is accurate from ScopedPrinters tests. There is a warning that we test for which throws off a full line match since it contains the readobj absolute path which varies by host test machine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In this context, I'm actually more interested in checking that there isn't anything on the line that is unexpected (e.g. garbage data etc).
FWIW, this is easily dealt with by adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good suggestion, I added match-full-lines to these tests. |
||
# RUN: llvm-readelf %t1.x64.o --bb-addr-map | FileCheck %s --check-prefix=GNU | ||
# RUN: llvm-readobj %t1.x64.o --pretty-pgo-analysis-map 2>&1 | FileCheck %s --check-prefix=PRETTY-NO-BAM | ||
|
||
## Check 32-bit: | ||
# RUN: yaml2obj %s -DBITS=32 -o %t1.x32.o | ||
# RUN: llvm-readobj %t1.x32.o --bb-addr-map 2>&1 | FileCheck -DADDR=0x11111 %s -DFILE=%t1.x32.o --check-prefix=CHECK | ||
# RUN: llvm-readobj %t1.x32.o --bb-addr-map 2>&1 | FileCheck -DADDR=0x11111 %s -DFILE=%t1.x32.o --check-prefixes=CHECK,RAW | ||
# RUN: llvm-readelf %t1.x32.o --bb-addr-map | FileCheck %s --check-prefix=GNU | ||
|
||
## Check that a malformed section can be handled. | ||
|
@@ -55,16 +57,19 @@ | |
# CHECK-NEXT: FuncEntryCount: 100 | ||
# CHECK-NEXT: PGO BB entries [ | ||
# CHECK-NEXT: { | ||
# CHECK-NEXT: Frequency: 100 | ||
# RAW-NEXT: Frequency: 100 | ||
# PRETTY-NEXT: Frequency: 1.0 | ||
# CHECK-NEXT: Successors [ | ||
# CHECK-NEXT: { | ||
# CHECK-NEXT: ID: 2 | ||
# CHECK-NEXT: Probability: 0xFFFFFFFF | ||
# RAW-NEXT: Probability: 0x80000000 | ||
# PRETTY-NEXT: Probability: 0x80000000 / 0x80000000 = 100.00% | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: { | ||
# CHECK-NEXT: Frequency: 100 | ||
# RAW-NEXT: Frequency: 100 | ||
# PRETTY-NEXT: Frequency: 1.0 | ||
# CHECK-NEXT: Successors [ | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: } | ||
|
@@ -95,7 +100,8 @@ | |
# CHECK-NEXT: FuncEntryCount: 8888 | ||
# CHECK-NEXT: PGO BB entries [ | ||
# CHECK-NEXT: { | ||
# CHECK-NEXT: Frequency: 9000 | ||
# RAW-NEXT: Frequency: 9000 | ||
# PRETTY-NEXT: Frequency: 1.0 | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: } | ||
|
@@ -104,6 +110,8 @@ | |
|
||
# GNU: GNUStyle::printBBAddrMaps not implemented | ||
|
||
# PRETTY-NO-BAM: warning: --bb-addr-map must be enabled for --pretty-pgo-analysis-map to have an effect | ||
|
||
# TRUNCATED: BBAddrMap [ | ||
# TRUNCATED-NEXT: warning: '[[FILE]]': unable to dump SHT_LLVM_BB_ADDR_MAP section with index 3: unable to decode LEB128 at offset [[OFFSET]]: malformed uleb128, extends past end | ||
# TRUNCATED-NEXT: ] | ||
|
@@ -192,7 +200,7 @@ Sections: | |
- BBFreq: 100 | ||
Successors: | ||
- ID: 2 | ||
BrProb: 0xFFFFFFFF | ||
BrProb: 0x80000000 | ||
- BBFreq: 100 | ||
Successors: [] | ||
- FuncEntryCount: 8888 | ||
|
Uh oh!
There was an error while loading. Please reload this page.