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