[PATCH] Add parsing support for discriminators and indirect call samples.

Diego Novillo dnovillo at google.com
Fri Dec 6 14:45:48 PST 2013


Hi chandlerc,

Our external profiler can emit more profile information that we
are currently not handling. This patch does not add new functionality
to support this information, but it allows profile files to provide it.

I will add actual support later on (for at least one of these features,
I need support for DWARF discriminators in Clang).

A sample line may contain the following additional information:

Discriminator. This is used if the sampled program was compiled with
DWARF discriminator support
(http://wiki.dwarfstd.org/index.php?title=Path_Discriminators). This
is currently only emitted by GCC and we just ignore it.

Potential call targets and samples. If present, this line contains a
call instruction. This models both direct and indirect calls. Each
called target is listed together with the number of samples. For
example,

130: 7  foo:3  bar:2  baz:7

The above means that at relative line offset 130 there is a
call instruction that calls one of foo(), bar() and baz(). With
baz() being the relatively more frequent call target.

http://llvm-reviews.chandlerc.com/D2355

Files:
  lib/Transforms/Scalar/SampleProfile.cpp
  test/Transforms/SampleProfile/Inputs/bad_sample_line.prof
  test/Transforms/SampleProfile/Inputs/calls.prof
  test/Transforms/SampleProfile/calls.ll
  test/Transforms/SampleProfile/syntax.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2355.1.patch
Type: text/x-patch
Size: 12492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131206/dcb20f84/attachment.bin>


More information about the llvm-commits mailing list