diff options
author | Dehao Chen <dehao@google.com> | 2017-04-19 20:09:38 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-04-19 20:09:38 +0000 |
commit | a364f09f185f65c3d23d93a313177ca8da3d7877 (patch) | |
tree | 8dda0f2421d3f3db90830b7bda71d73391329c7d /llvm/test/tools/llvm-symbolizer | |
parent | 6e2ec5f10ecca4db786cb5d2c3c4f1701a940385 (diff) | |
download | bcm5719-llvm-a364f09f185f65c3d23d93a313177ca8da3d7877.tar.gz bcm5719-llvm-a364f09f185f65c3d23d93a313177ca8da3d7877.zip |
Using address range map to speedup finding inline stack for address.
Summary:
In the current implementation, to find inline stack for an address incurs expensive linear search in 2 places:
* linear search for the top-level DIE
* recursive linear traverse the DIE tree to find the path to the leaf DIE
In this patch, a map is built from address to its corresponding leaf DIE. The inline stack is built by traversing from the leaf DIE up to the root DIE. This speeds up batch symbolization by ~10X without noticible memory overhead.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32177
llvm-svn: 300742
Diffstat (limited to 'llvm/test/tools/llvm-symbolizer')
-rw-r--r-- | llvm/test/tools/llvm-symbolizer/padding-x86_64.ll | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-symbolizer/padding-x86_64.ll b/llvm/test/tools/llvm-symbolizer/padding-x86_64.ll new file mode 100644 index 00000000000..114c9f701c6 --- /dev/null +++ b/llvm/test/tools/llvm-symbolizer/padding-x86_64.ll @@ -0,0 +1,40 @@ +; REQUIRES: x86_64-linux +; Checks if symbolizer can correctly symbolize address in the padding between +; functions. +; RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %s +; RUN: echo 0x5 | llvm-symbolizer -obj=%t.o | FileCheck %s --check-prefix=FOO +; RUN: echo 0xd | llvm-symbolizer -obj=%t.o | FileCheck %s --check-prefix=PADDING +; RUN: echo 0x10 | llvm-symbolizer -obj=%t.o | FileCheck %s --check-prefix=MAIN + +;FOO: foo +;PADDING: ?? +;MAIN: main + +@a = global i32 1, align 4 + +define i32 @foo() !dbg !9 { +entry: + %0 = load i32, i32* @a, align 4 + ret i32 %0 +} + +define i32 @main() !dbg !14 { +entry: + %call = call i32 @foo(), !dbg !18 + ret i32 %call +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!6, !7} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "padding-x86_64.c", directory: "/tmp/") +!2 = !{} +!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !{i32 2, !"Dwarf Version", i32 4} +!7 = !{i32 2, !"Debug Info Version", i32 3} +!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, variables: !2) +!10 = !DISubroutineType(types: !11) +!11 = !{!5} +!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !10, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: false, unit: !0, variables: !2) +!18 = !DILocation(line: 7, column: 8, scope: !14) |