xref: /llvm-project/llvm/docs/CommandGuide/llvm-cgdata.rst (revision ffcf3c8688f57acaf6a404a1238673c9d197ba9a)
1ef403f9aSKyungwoo Leellvm-cgdata - LLVM CodeGen Data Tool
2ef403f9aSKyungwoo Lee====================================
3ef403f9aSKyungwoo Lee
4ef403f9aSKyungwoo Lee.. program:: llvm-cgdata
5ef403f9aSKyungwoo Lee
6ef403f9aSKyungwoo LeeSYNOPSIS
7ef403f9aSKyungwoo Lee--------
8ef403f9aSKyungwoo Lee
9ef403f9aSKyungwoo Lee:program:`llvm-cgdata` [**commands**] [**options**] (<binaries>|<.cgdata>)
10ef403f9aSKyungwoo Lee
11ef403f9aSKyungwoo LeeDESCRIPTION
12ef403f9aSKyungwoo Lee-----------
13ef403f9aSKyungwoo Lee
14*ffcf3c86SKyungwoo LeeThe :program:llvm-cgdata utility parses raw codegen data embedded in compiled
15*ffcf3c86SKyungwoo Leebinary files and merges them into a single .cgdata file. It can also inspect
16*ffcf3c86SKyungwoo Leeand manipulate .cgdata files. Currently, the tool supports saving and restoring
17*ffcf3c86SKyungwoo Leeoutlined hash trees and stable function maps, allowing for more efficient
18*ffcf3c86SKyungwoo Leefunction outlining and function merging across modules in subsequent
19*ffcf3c86SKyungwoo Leecompilations. The design is extensible, allowing for the incorporation of
20*ffcf3c86SKyungwoo Leeadditional codegen summaries and optimization techniques.
21ef403f9aSKyungwoo Lee
22ef403f9aSKyungwoo LeeCOMMANDS
23ef403f9aSKyungwoo Lee--------
24ef403f9aSKyungwoo Lee
25ef403f9aSKyungwoo LeeAt least one of the following commands are required:
26ef403f9aSKyungwoo Lee
27ef403f9aSKyungwoo Lee.. option:: --convert
28ef403f9aSKyungwoo Lee
29ef403f9aSKyungwoo Lee  Convert a .cgdata file from one format to another.
30ef403f9aSKyungwoo Lee
31ef403f9aSKyungwoo Lee.. option:: --merge
32ef403f9aSKyungwoo Lee
33ef403f9aSKyungwoo Lee  Merge multiple raw codgen data in binaries into a single .cgdata file.
34ef403f9aSKyungwoo Lee
35ef403f9aSKyungwoo Lee.. option:: --show
36ef403f9aSKyungwoo Lee
37ef403f9aSKyungwoo Lee  Show summary information about a .cgdata file.
38ef403f9aSKyungwoo Lee
39ef403f9aSKyungwoo LeeOPTIONS
40ef403f9aSKyungwoo Lee-------
41ef403f9aSKyungwoo Lee
42ef403f9aSKyungwoo Lee:program:`llvm-cgdata` supports the following options:
43ef403f9aSKyungwoo Lee
44ef403f9aSKyungwoo Lee.. option:: --format=[text|binary]
45ef403f9aSKyungwoo Lee
46ef403f9aSKyungwoo Lee  Specify the format of the output .cgdata file.
47ef403f9aSKyungwoo Lee
48ef403f9aSKyungwoo Lee.. option:: --output=<string>
49ef403f9aSKyungwoo Lee
50ef403f9aSKyungwoo Lee  Specify the output file name.
51ef403f9aSKyungwoo Lee
52ef403f9aSKyungwoo Lee.. option:: --cgdata-version
53ef403f9aSKyungwoo Lee
54ef403f9aSKyungwoo Lee  Print the version of the llvm-cgdata tool.
55ef403f9aSKyungwoo Lee
56ef403f9aSKyungwoo LeeEXAMPLES
57ef403f9aSKyungwoo Lee--------
58ef403f9aSKyungwoo Lee
59ef403f9aSKyungwoo LeeTo convert a .cgdata file from binary to text format:
60ef403f9aSKyungwoo Lee    $ llvm-cgdata --convert --format=text input.cgdata --output=output.data
61ef403f9aSKyungwoo Lee
62ef403f9aSKyungwoo LeeTo merge multiple raw codegen data in object files into a single .cgdata file:
63ef403f9aSKyungwoo Lee    $ llvm-cgdata --merge file1.o file2.o --output=merged.cgdata
64ef403f9aSKyungwoo Lee
65ef403f9aSKyungwoo LeeTo show summary information about a .cgdata file:
66ef403f9aSKyungwoo Lee    $ llvm-cgdata --show input.cgdata
67