This is an archive of the discontinued LLVM Phabricator instance.

make llvm-profdata show -text work as advertised in the documentation
ClosedPublic

Authored by rsmith on Aug 23 2018, 3:20 PM.

Details

Summary

Per LLVM's CommandGuide, llvm-profdata show -text is supposed to produce textual output that can be passed as input to further llvm-profdata invocations. This doesn't currently work for two reasons:

  1. -text was not sufficient to enable the machine-readable text format output; instead, -text was effectively ignored if -counts was not also specified. (With this patch, -counts is instead ignored if -text is specified, because the machine-readable text format always includes counts.)
  2. When the input data was an IR-level profile, the :ir marker was missing from the output, resulting in a text format output that would not be usable as profiling data due to function hash mismatches.

Diff Detail

Repository
rL LLVM

Event Timeline

rsmith created this revision.Aug 23 2018, 3:20 PM
davidxl accepted this revision.Aug 23 2018, 3:30 PM

lgtm

(-text option with show command is a 'mis-feature', -text should really be used together with the 'merge' command, but it is too late to remove it now).

This revision is now accepted and ready to land.Aug 23 2018, 3:30 PM
This revision was automatically updated to reflect the committed changes.