diff options
author | Diego Novillo <dnovillo@google.com> | 2014-01-10 23:23:51 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2014-01-10 23:23:51 +0000 |
commit | 4b2b2da9c76acff7f38854ad4187ce2a3d46da9d (patch) | |
tree | ec87b8eb0bfbb3844615d88334a9fe13dd436dcd /test/Transforms/SampleProfile/Inputs | |
parent | 0de8cecb840e1b332a0a6f39855ddecda94202e8 (diff) | |
download | llvm-4b2b2da9c76acff7f38854ad4187ce2a3d46da9d.tar.gz llvm-4b2b2da9c76acff7f38854ad4187ce2a3d46da9d.tar.bz2 llvm-4b2b2da9c76acff7f38854ad4187ce2a3d46da9d.tar.xz |
Extend and simplify the sample profile input file.
1- Use the line_iterator class to read profile files.
2- Allow comments in profile file. Lines starting with '#'
are completely ignored while reading the profile.
3- Add parsing support for discriminators and indirect call samples.
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.
Differential Revision: http://llvm-reviews.chandlerc.com/D2355
4- Simplify format of profile input file.
This implements earlier suggestions to simplify the format of the
sample profile file. The symbol table is not necessary and function
profiles do not need to know the number of samples in advance.
Differential Revision: http://llvm-reviews.chandlerc.com/D2419
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SampleProfile/Inputs')
9 files changed, 15 insertions, 35 deletions
diff --git a/test/Transforms/SampleProfile/Inputs/bad_fn_header.prof b/test/Transforms/SampleProfile/Inputs/bad_fn_header.prof index 90459e65d0..763956f068 100644 --- a/test/Transforms/SampleProfile/Inputs/bad_fn_header.prof +++ b/test/Transforms/SampleProfile/Inputs/bad_fn_header.prof @@ -1,6 +1,3 @@ -symbol table -1 -empty empty:100:BAD 0: 0 1: 100 diff --git a/test/Transforms/SampleProfile/Inputs/bad_sample_line.prof b/test/Transforms/SampleProfile/Inputs/bad_sample_line.prof index 8c0d7630f9..038c45f77e 100644 --- a/test/Transforms/SampleProfile/Inputs/bad_sample_line.prof +++ b/test/Transforms/SampleProfile/Inputs/bad_sample_line.prof @@ -1,6 +1,3 @@ -symbol table -1 -empty -empty:100:0:1 +empty:100:0 0: 0 1: BAD diff --git a/test/Transforms/SampleProfile/Inputs/branch.prof b/test/Transforms/SampleProfile/Inputs/branch.prof index d19894d428..cd1cb5b1f1 100644 --- a/test/Transforms/SampleProfile/Inputs/branch.prof +++ b/test/Transforms/SampleProfile/Inputs/branch.prof @@ -1,7 +1,4 @@ -symbol table -1 -main -main:15680:0:7 +main:15680:0 0: 0 4: 0 7: 0 diff --git a/test/Transforms/SampleProfile/Inputs/calls.prof b/test/Transforms/SampleProfile/Inputs/calls.prof new file mode 100644 index 0000000000..251cb538ef --- /dev/null +++ b/test/Transforms/SampleProfile/Inputs/calls.prof @@ -0,0 +1,11 @@ +_Z3sumii:105580:5279 +0: 5279 +1: 5279 +2: 5279 +main:225715:0 +2: 5553 +3: 5391 +# This indicates that at line 3 of this function, the 'then' branch +# of the conditional is taken (discriminator '1'). However, we still +# do not handle this case, so we compute the wrong branch weights here. +3.1: 5752 _Z3sumii:5860 diff --git a/test/Transforms/SampleProfile/Inputs/missing_num_syms.prof b/test/Transforms/SampleProfile/Inputs/missing_num_syms.prof deleted file mode 100644 index 7cd053611c..0000000000 --- a/test/Transforms/SampleProfile/Inputs/missing_num_syms.prof +++ /dev/null @@ -1,5 +0,0 @@ -symbol table -empty -empty:100:0:1 -0: 0 -1: 100 diff --git a/test/Transforms/SampleProfile/Inputs/missing_samples.prof b/test/Transforms/SampleProfile/Inputs/missing_samples.prof deleted file mode 100644 index edd36c2f52..0000000000 --- a/test/Transforms/SampleProfile/Inputs/missing_samples.prof +++ /dev/null @@ -1,6 +0,0 @@ -symbol table -1 -empty -empty:100:0:10 -0: 0 -1: 100 diff --git a/test/Transforms/SampleProfile/Inputs/missing_symtab.prof b/test/Transforms/SampleProfile/Inputs/missing_symtab.prof deleted file mode 100644 index 2a826138b0..0000000000 --- a/test/Transforms/SampleProfile/Inputs/missing_symtab.prof +++ /dev/null @@ -1,5 +0,0 @@ -1 -empty -empty:100:0:1 -0: 0 -1: 100 diff --git a/test/Transforms/SampleProfile/Inputs/propagate.prof b/test/Transforms/SampleProfile/Inputs/propagate.prof index ea799e93ee..b28609be66 100644 --- a/test/Transforms/SampleProfile/Inputs/propagate.prof +++ b/test/Transforms/SampleProfile/Inputs/propagate.prof @@ -1,7 +1,4 @@ -symbol table -1 -_Z3fooiil -_Z3fooiil:58139:0:16 +_Z3fooiil:58139:0 0: 0 1: 0 2: 0 diff --git a/test/Transforms/SampleProfile/Inputs/syntax.prof b/test/Transforms/SampleProfile/Inputs/syntax.prof index 9280751b2d..f3738912a9 100644 --- a/test/Transforms/SampleProfile/Inputs/syntax.prof +++ b/test/Transforms/SampleProfile/Inputs/syntax.prof @@ -1,6 +1,3 @@ -symbol table -1 -empty -empty:100:0:2 +empty:100:0 0: 0 1: 100 |