aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide
diff options
context:
space:
mode:
authorMicah Weston <micahsweston@gmail.com>2024-02-27 14:13:00 -0500
committerGitHub <noreply@github.com>2024-02-27 14:13:00 -0500
commit9ca8db352d22444feabd859380252f13826a8aff (patch)
treef3aeac0d336a4851c07525c4e4707596af57f450 /llvm/docs/CommandGuide
parent19181f24e516ce1cb58cd5ba27515eb968ae22d9 (diff)
downloadllvm-9ca8db352d22444feabd859380252f13826a8aff.zip
llvm-9ca8db352d22444feabd859380252f13826a8aff.tar.gz
llvm-9ca8db352d22444feabd859380252f13826a8aff.tar.bz2
[SHT_LLVM_BB_ADDR_MAP] Adds pretty printing of BFI and BPI for PGO Analysis Map in tools. (#82292)
Primary change is to add a flag `--pretty-pgo-analysis-map` to llvm-readobj and llvm-objdump that prints block frequencies and branch probabilities in the same manner as BFI and BPI respectively. This can be helpful if you are manually inspecting the outputs from the tools. In order to print, I moved the `printBlockFreqImpl` function from Analysis to Support and renamed it to `printRelativeBlockFreq`.
Diffstat (limited to 'llvm/docs/CommandGuide')
-rw-r--r--llvm/docs/CommandGuide/llvm-objdump.rst16
-rw-r--r--llvm/docs/CommandGuide/llvm-readobj.rst11
2 files changed, 26 insertions, 1 deletions
diff --git a/llvm/docs/CommandGuide/llvm-objdump.rst b/llvm/docs/CommandGuide/llvm-objdump.rst
index 959452a7..7f8def7 100644
--- a/llvm/docs/CommandGuide/llvm-objdump.rst
+++ b/llvm/docs/CommandGuide/llvm-objdump.rst
@@ -271,7 +271,12 @@ OPTIONS
When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.
- When a bb-address-map section is present (i.e., the object file is built with ``-fbasic-block-sections=labels``), labels are retrieved from that section instead.
+ When a bb-address-map section is present (i.e., the object file is built with
+ ``-fbasic-block-sections=labels``), labels are retrieved from that section
+ instead. If a pgo-analysis-map is present alongside the bb-address-map, any
+ available analyses are printed after the relevant block label. By default,
+ any analysis with a special representation (i.e. BlockFrequency,
+ BranchProbability, etc) are printed as raw hex values.
Only works with PowerPC objects or X86 linked images.
@@ -291,6 +296,15 @@ OPTIONS
cmp eax, dword ptr <g>
jge <L0>
+.. option:: --pretty-pgo-analysis-map
+
+ When using :option:`--symbolize-operands` with bb-address-map and
+ pgo-analysis-map, print analyses using the same format as their analysis
+ passes would. An example of pretty format would be printing block frequencies
+ relative to the entry block, the same as BFI.
+
+ Only works when :option:`--symbolize-operands` is enabled.
+
.. option:: --triple=<string>
Target triple to disassemble for, see ``--version`` for available targets.
diff --git a/llvm/docs/CommandGuide/llvm-readobj.rst b/llvm/docs/CommandGuide/llvm-readobj.rst
index 6d78a03..09dabb2 100644
--- a/llvm/docs/CommandGuide/llvm-readobj.rst
+++ b/llvm/docs/CommandGuide/llvm-readobj.rst
@@ -164,6 +164,17 @@ The following options are implemented only for the ELF file format.
Display the contents of the basic block address map section(s), which contain the
address of each function, along with the relative offset of each basic block.
+ When pgo analysis maps are present, all analyses are printed as their raw
+ value.
+
+.. option:: --pretty-pgo-analysis-map
+
+ When pgo analysis maps are present in the basic block address map section(s),
+ analyses with special formats (i.e. BlockFrequency, BranchProbability, etc)
+ are printed using the same format as their respective analysis pass.
+
+ Requires :option:`--bb-addr-map` to have an effect.
+
.. option:: --demangle, -C
Display demangled symbol names in the output.