Skip to content

Commit ef403f9

Browse files
authored
[CGData] Document for llvm-cgdata (#106320)
This is a follow-up for #101461. This is a patch for https://discourse.llvm.org/t/rfc-enhanced-machine-outliner-part-2-thinlto-nolto/78753.
1 parent c2cac69 commit ef403f9

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

llvm/docs/CommandGuide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Basic Commands
1818
llc
1919
lli
2020
llvm-as
21+
llvm-cgdata
2122
llvm-config
2223
llvm-cov
2324
llvm-cxxmap
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
llvm-cgdata - LLVM CodeGen Data Tool
2+
====================================
3+
4+
.. program:: llvm-cgdata
5+
6+
SYNOPSIS
7+
--------
8+
9+
:program:`llvm-cgdata` [**commands**] [**options**] (<binaries>|<.cgdata>)
10+
11+
DESCRIPTION
12+
-----------
13+
14+
The :program:llvm-cgdata utility parses raw codegen data embedded
15+
in compiled binary files and merges them into a single .cgdata file.
16+
It can also inspect and manipulate .cgdata files.
17+
Currently, the tool supports saving and restoring outlined hash trees,
18+
enabling global function outlining across modules, allowing for more
19+
efficient function outlining in subsequent compilations.
20+
The design is extensible, allowing for the incorporation of additional
21+
codegen summaries and optimization techniques, such as global function
22+
merging, in the future.
23+
24+
COMMANDS
25+
--------
26+
27+
At least one of the following commands are required:
28+
29+
.. option:: --convert
30+
31+
Convert a .cgdata file from one format to another.
32+
33+
.. option:: --merge
34+
35+
Merge multiple raw codgen data in binaries into a single .cgdata file.
36+
37+
.. option:: --show
38+
39+
Show summary information about a .cgdata file.
40+
41+
OPTIONS
42+
-------
43+
44+
:program:`llvm-cgdata` supports the following options:
45+
46+
.. option:: --format=[text|binary]
47+
48+
Specify the format of the output .cgdata file.
49+
50+
.. option:: --output=<string>
51+
52+
Specify the output file name.
53+
54+
.. option:: --cgdata-version
55+
56+
Print the version of the llvm-cgdata tool.
57+
58+
EXAMPLES
59+
--------
60+
61+
To convert a .cgdata file from binary to text format:
62+
$ llvm-cgdata --convert --format=text input.cgdata --output=output.data
63+
64+
To merge multiple raw codegen data in object files into a single .cgdata file:
65+
$ llvm-cgdata --merge file1.o file2.o --output=merged.cgdata
66+
67+
To show summary information about a .cgdata file:
68+
$ llvm-cgdata --show input.cgdata

0 commit comments

Comments
 (0)