llvm-profdata merge takes several profile data files
generated by PGO instrumentation and merges them together into a single
indexed profile data file.

By default profile data is merged without modification. This means that the
relative importance of each input file is proportional to the number of samples
or counts it contains. In general, the input from a longer training run will be
interpreted as relatively more important than a shorter run. Depending on the
nature of the training runs it may be useful to adjust the weight given to each
input file by using the -weighted-input option.

Profiles passed in via -weighted-input, -input-files, or via positional
arguments are processed once for each time they are seen.

Specify an input file name along with a weight. The profile counts of the
supplied filename will be scaled (multiplied) by the supplied
weight, where where weight is a decimal integer >= 1.
Input files specified without using this option are assigned a default
weight of 1. Examples are shown below.

Specify a file which contains a list of files to merge. The entries in this
file are newline-separated. Lines starting with ‘#’ are skipped. Entries may
be of the form <filename> or <weight>,<filename>.

Specify a file which contains a remapping from symbol names in the input
profile to the symbol names that should be used in the output profile. The
file should consist of lines of the form <input-symbol><output-symbol>.
Blank lines and lines starting with # are skipped.

The llvm-cxxmap tool can be used to generate the symbol
remapping file.

Emit the profile in text mode. This option can also be used with both
sample-based and instrumentation-based profile. When this option is used
the profile will be dumped in the text format that is parsable by the profile
reader.

Set the failure mode. There are two options: ‘any’ causes the merge command to
fail if any profiles are invalid, and ‘all’ causes the merge command to fail
only if all profiles are invalid. If ‘all’ is set, information from any
invalid profiles is excluded from the final merged product. The default
failure mode is ‘any’.

Instruct the profile dumper to show profile counts in the text format of the
instrumentation-based profile data representation. By default, the profile
information is dumped in a more human readable form (also in text) with
annotations.