summaryrefslogtreecommitdiff
path: root/test/Transforms/SampleProfile/syntax.ll
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-01-10 23:23:51 +0000
committerDiego Novillo <dnovillo@google.com>2014-01-10 23:23:51 +0000
commit4b2b2da9c76acff7f38854ad4187ce2a3d46da9d (patch)
treeec87b8eb0bfbb3844615d88334a9fe13dd436dcd /test/Transforms/SampleProfile/syntax.ll
parent0de8cecb840e1b332a0a6f39855ddecda94202e8 (diff)
downloadllvm-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/syntax.ll')
-rw-r--r--test/Transforms/SampleProfile/syntax.ll10
1 files changed, 2 insertions, 8 deletions
diff --git a/test/Transforms/SampleProfile/syntax.ll b/test/Transforms/SampleProfile/syntax.ll
index 41a08bc295..4fdfeae849 100644
--- a/test/Transforms/SampleProfile/syntax.ll
+++ b/test/Transforms/SampleProfile/syntax.ll
@@ -1,10 +1,7 @@
; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/syntax.prof 2>&1 | FileCheck -check-prefix=NO-DEBUG %s
; RUN: not opt < %s -sample-profile -sample-profile-file=missing.prof 2>&1 | FileCheck -check-prefix=MISSING-FILE %s
-; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/missing_symtab.prof 2>&1 | FileCheck -check-prefix=MISSING-SYMTAB %s
-; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/missing_num_syms.prof 2>&1 | FileCheck -check-prefix=MISSING-NUM-SYMS %s
; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_fn_header.prof 2>&1 | FileCheck -check-prefix=BAD-FN-HEADER %s
; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_sample_line.prof 2>&1 | FileCheck -check-prefix=BAD-SAMPLE-LINE %s
-; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/missing_samples.prof 2>&1 | FileCheck -check-prefix=MISSING-SAMPLES %s
define void @empty() {
entry:
@@ -12,8 +9,5 @@ entry:
}
; NO-DEBUG: LLVM ERROR: No debug information found in function empty
; MISSING-FILE: LLVM ERROR: Could not open file missing.prof: No such file or directory
-; MISSING-SYMTAB: LLVM ERROR: {{.*}}missing_symtab.prof:1: Expected 'symbol table', found 1
-; MISSING-NUM-SYMS: LLVM ERROR: {{.*}}missing_num_syms.prof:2: Expected a number, found empty
-; BAD-FN-HEADER: LLVM ERROR: {{.*}}bad_fn_header.prof:4: Expected 'mangled_name:NUM:NUM:NUM', found empty:100:BAD
-; BAD-SAMPLE-LINE: LLVM ERROR: {{.*}}bad_sample_line.prof:6: Expected 'mangled_name:NUM:NUM:NUM', found 1: BAD
-; MISSING-SAMPLES: LLVM ERROR: {{.*}}missing_samples.prof:6: Unexpected end of file
+; BAD-FN-HEADER: LLVM ERROR: {{.*}}bad_fn_header.prof:1: Expected 'mangled_name:NUM:NUM', found empty:100:BAD
+; BAD-SAMPLE-LINE: LLVM ERROR: {{.*}}bad_sample_line.prof:3: Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found 1: BAD