Skip to content

[CGData] Document for llvm-cgdata #106320

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

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/docs/CommandGuide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Basic Commands
llc
lli
llvm-as
llvm-cgdata
llvm-config
llvm-cov
llvm-cxxmap
Expand Down
68 changes: 68 additions & 0 deletions llvm/docs/CommandGuide/llvm-cgdata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
llvm-cgdata - LLVM CodeGen Data Tool
====================================

.. program:: llvm-cgdata

SYNOPSIS
--------

:program:`llvm-cgdata` [**commands**] [**options**] (<binaries>|<.cgdata>)

DESCRIPTION
-----------

The :program:llvm-cgdata utility parses raw codegen data embedded
in compiled binary files and merges them into a single .cgdata file.
It can also inspect and manipulate .cgdata files.
Currently, the tool supports saving and restoring outlined hash trees,
enabling global function outlining across modules, allowing for more
efficient function outlining in subsequent compilations.
The design is extensible, allowing for the incorporation of additional
codegen summaries and optimization techniques, such as global function
merging, in the future.

COMMANDS
--------

At least one of the following commands are required:

.. option:: --convert

Convert a .cgdata file from one format to another.

.. option:: --merge

Merge multiple raw codgen data in binaries into a single .cgdata file.

.. option:: --show

Show summary information about a .cgdata file.

OPTIONS
-------

:program:`llvm-cgdata` supports the following options:

.. option:: --format=[text|binary]

Specify the format of the output .cgdata file.

.. option:: --output=<string>

Specify the output file name.

.. option:: --cgdata-version

Print the version of the llvm-cgdata tool.

EXAMPLES
--------

To convert a .cgdata file from binary to text format:
$ llvm-cgdata --convert --format=text input.cgdata --output=output.data

To merge multiple raw codegen data in object files into a single .cgdata file:
$ llvm-cgdata --merge file1.o file2.o --output=merged.cgdata

To show summary information about a .cgdata file:
$ llvm-cgdata --show input.cgdata
Loading