diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-13 20:22:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-13 20:22:02 +0000 |
commit | 3164fcfd273b37931e30a631f525d52ac2897fc0 (patch) | |
tree | d479607972de427c95f835c932659126e37ab436 /llvm/test | |
parent | 2ce2652716aa1314d23b70895c67c6043842d7bd (diff) | |
download | bcm5719-llvm-3164fcfd273b37931e30a631f525d52ac2897fc0.tar.gz bcm5719-llvm-3164fcfd273b37931e30a631f525d52ac2897fc0.zip |
Add flag to llvm-profdata to allow symbols in profile data to be remapped, and
add a tool to generate symbol remapping files.
Summary:
The new tool llvm-cxxmap builds a symbol mapping table from a file containing
a description of partial equivalences to apply to mangled names and files
containing old and new symbol tables.
Reviewers: davidxl
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D51470
llvm-svn: 342168
Diffstat (limited to 'llvm/test')
17 files changed, 121 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-cxxmap/Inputs/after.sym b/llvm/test/tools/llvm-cxxmap/Inputs/after.sym new file mode 100644 index 00000000000..3dc6941b6cc --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/Inputs/after.sym @@ -0,0 +1,2 @@ +_ZN1N1fEN1M1X1YE +_ZN3foo6detail3qux1fEv diff --git a/llvm/test/tools/llvm-cxxmap/Inputs/ambiguous.sym b/llvm/test/tools/llvm-cxxmap/Inputs/ambiguous.sym new file mode 100644 index 00000000000..e06fd6a1f21 --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/Inputs/ambiguous.sym @@ -0,0 +1,2 @@ +_ZN1N1fENS_1X1YE +_ZN1N1fEN1M1X1YE diff --git a/llvm/test/tools/llvm-cxxmap/Inputs/before.sym b/llvm/test/tools/llvm-cxxmap/Inputs/before.sym new file mode 100644 index 00000000000..c6f563c80a0 --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/Inputs/before.sym @@ -0,0 +1,2 @@ +_ZN3foo4quux1fEv +_ZN1N1fENS_1X1YE diff --git a/llvm/test/tools/llvm-cxxmap/Inputs/expected b/llvm/test/tools/llvm-cxxmap/Inputs/expected new file mode 100644 index 00000000000..eb2cdcf8540 --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/Inputs/expected @@ -0,0 +1,2 @@ +_ZN3foo4quux1fEv _ZN3foo6detail3qux1fEv +_ZN1N1fENS_1X1YE _ZN1N1fEN1M1X1YE diff --git a/llvm/test/tools/llvm-cxxmap/Inputs/incomplete.sym b/llvm/test/tools/llvm-cxxmap/Inputs/incomplete.sym new file mode 100644 index 00000000000..a45225073cb --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/Inputs/incomplete.sym @@ -0,0 +1 @@ +_ZN3foo6detail3qux1fEv diff --git a/llvm/test/tools/llvm-cxxmap/Inputs/remap.map b/llvm/test/tools/llvm-cxxmap/Inputs/remap.map new file mode 100644 index 00000000000..df3d82d38bd --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/Inputs/remap.map @@ -0,0 +1,8 @@ +# foo:: and foo::detail:: are equivalent +name 3foo N3foo6detailE + +# foo::qux and foo::quux are equivalent +type N3foo3quxE N3foo4quuxE + +# N::X and M::X are equivalent +name N1N1XE N1M1XE diff --git a/llvm/test/tools/llvm-cxxmap/ambiguous.test b/llvm/test/tools/llvm-cxxmap/ambiguous.test new file mode 100644 index 00000000000..5162f7be0d0 --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/ambiguous.test @@ -0,0 +1,2 @@ +RUN: llvm-cxxmap %S/Inputs/before.sym %S/Inputs/ambiguous.sym -r %S/Inputs/remap.map -o /dev/null -Wambiguous 2>&1 | FileCheck %s +CHECK: warning: {{.*}}:2: symbol _ZN1N1fEN1M1X1YE is equivalent to earlier symbol _ZN1N1fENS_1X1YE diff --git a/llvm/test/tools/llvm-cxxmap/incomplete.test b/llvm/test/tools/llvm-cxxmap/incomplete.test new file mode 100644 index 00000000000..c1da9588783 --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/incomplete.test @@ -0,0 +1,2 @@ +RUN: llvm-cxxmap %S/Inputs/before.sym %S/Inputs/incomplete.sym -r %S/Inputs/remap.map -o /dev/null -Wincomplete 2>&1 | FileCheck %s +CHECK: warning: {{.*}}:2: no new symbol matches old symbol _ZN1N1fENS_1X1YE diff --git a/llvm/test/tools/llvm-cxxmap/remap.test b/llvm/test/tools/llvm-cxxmap/remap.test new file mode 100644 index 00000000000..e22c36c9dbf --- /dev/null +++ b/llvm/test/tools/llvm-cxxmap/remap.test @@ -0,0 +1,5 @@ +RUN: llvm-cxxmap %S/Inputs/before.sym %S/Inputs/after.sym -r %S/Inputs/remap.map -o %t.output -Wambiguous -Wincomplete 2>&1 | FileCheck %s --allow-empty +RUN: diff %S/Inputs/expected %t.output + +CHECK-NOT: warning +CHECK-NOT: error diff --git a/llvm/test/tools/llvm-profdata/Inputs/instr-remap.expected b/llvm/test/tools/llvm-profdata/Inputs/instr-remap.expected new file mode 100644 index 00000000000..f5ff5273011 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/instr-remap.expected @@ -0,0 +1,29 @@ +# IR level Instrumentation Flag +:ir +bar +# Func Hash: +1234 +# Num Counters: +2 +# Counter Values: +31 +42 + +bar +# Func Hash: +5678 +# Num Counters: +2 +# Counter Values: +500 +600 + +baz +# Func Hash: +5678 +# Num Counters: +2 +# Counter Values: +7 +8 + diff --git a/llvm/test/tools/llvm-profdata/Inputs/instr-remap.proftext b/llvm/test/tools/llvm-profdata/Inputs/instr-remap.proftext new file mode 100644 index 00000000000..ddd66719d8b --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/instr-remap.proftext @@ -0,0 +1,25 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +foo +1234 +2 +1 +2 + +bar +1234 +2 +30 +40 + +foo +5678 +2 +500 +600 + +baz +5678 +2 +7 +8 diff --git a/llvm/test/tools/llvm-profdata/Inputs/instr-remap.remap b/llvm/test/tools/llvm-profdata/Inputs/instr-remap.remap new file mode 100644 index 00000000000..d675fa44e50 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/instr-remap.remap @@ -0,0 +1 @@ +foo bar diff --git a/llvm/test/tools/llvm-profdata/Inputs/sample-remap.expected b/llvm/test/tools/llvm-profdata/Inputs/sample-remap.expected new file mode 100644 index 00000000000..863ea1e0725 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/sample-remap.expected @@ -0,0 +1,16 @@ +main:184019:0 + 4: 534 + 4.2: 534 + 5: 1075 + 5.1: 1075 + 6: 2080 + 7: 534 + 9: 2064 _Z3bazi:1471 _Z3fooi:631 + 10: inline2:2000 + 1: 2000 + 10: inline42:1000 + 1: 1000 +_Z3bazi:40602:2437 + 1: 2437 +_Z3fooi:7711:610 + 1: 610 diff --git a/llvm/test/tools/llvm-profdata/Inputs/sample-remap.proftext b/llvm/test/tools/llvm-profdata/Inputs/sample-remap.proftext new file mode 100644 index 00000000000..33fce647b43 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/sample-remap.proftext @@ -0,0 +1,18 @@ +_Z3bari:20301:1437 + 1: 1437 +_Z3fooi:7711:610 + 1: 610 +main:184019:0 + 4: 534 + 4.2: 534 + 5: 1075 + 5.1: 1075 + 6: 2080 + 7: 534 + 9: 2064 _Z3bari:1471 _Z3fooi:631 + 10: inline1:1000 + 1: 1000 + 10: inline2:2000 + 1: 2000 +_Z3bazi:20301:1000 + 1: 1000 diff --git a/llvm/test/tools/llvm-profdata/Inputs/sample-remap.remap b/llvm/test/tools/llvm-profdata/Inputs/sample-remap.remap new file mode 100644 index 00000000000..465c45cf25b --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/sample-remap.remap @@ -0,0 +1,2 @@ +_Z3bari _Z3bazi +inline1 inline42 diff --git a/llvm/test/tools/llvm-profdata/instr-remap.test b/llvm/test/tools/llvm-profdata/instr-remap.test new file mode 100644 index 00000000000..159b7374ac3 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/instr-remap.test @@ -0,0 +1,2 @@ +; RUN: llvm-profdata merge -text %S/Inputs/instr-remap.proftext -r %S/Inputs/instr-remap.remap -o %t.output +; RUN: diff %S/Inputs/instr-remap.expected %t.output diff --git a/llvm/test/tools/llvm-profdata/sample-remap.test b/llvm/test/tools/llvm-profdata/sample-remap.test new file mode 100644 index 00000000000..a6afd925ff9 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/sample-remap.test @@ -0,0 +1,2 @@ +; RUN: llvm-profdata merge -sample -text %S/Inputs/sample-remap.proftext -r %S/Inputs/sample-remap.remap -o %t.output +; RUN: diff %S/Inputs/sample-remap.expected %t.output |