llvm.org GIT mirror llvm / e17e33b
Fix the JIT event listeners and replace the associated tests. The changes to EventListenerCommon.h were contributed by Arch Robison. This fixes bug 22095. http://reviews.llvm.org/D6905 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225554 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Kaylor 5 years ago
7 changed file(s) with 290 addition(s) and 604 deletion(s). Raw diff Collapse all Expand all
None //===-- JIT.h - Abstract Execution Engine Interface -------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Common functionality for JITEventListener implementations
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef EVENT_LISTENER_COMMON_H
14 #define EVENT_LISTENER_COMMON_H
15
16 #include "llvm/ADT/DenseMap.h"
17 #include "llvm/IR/DebugInfo.h"
18 #include "llvm/IR/Metadata.h"
19 #include "llvm/IR/ValueHandle.h"
20 #include "llvm/Support/Path.h"
21
22 namespace llvm {
23
24 namespace jitprofiling {
25
26 class FilenameCache {
27 // Holds the filename of each Scope, so that we can pass a null-terminated
28 // string into oprofile. Use an AssertingVH rather than a ValueMap because we
29 // shouldn't be modifying any MDNodes while this map is alive.
30 DenseMap, std::string> Filenames;
31 DenseMap, std::string> Paths;
32
33 public:
34 const char *getFilename(MDNode *Scope) {
35 std::string &Filename = Filenames[Scope];
36 if (Filename.empty()) {
37 DIScope DIScope(Scope);
38 Filename = DIScope.getFilename();
39 }
40 return Filename.c_str();
41 }
42
43 const char *getFullPath(MDNode *Scope) {
44 std::string &P = Paths[Scope];
45 if (P.empty()) {
46 DIScope DIScope(Scope);
47 StringRef DirName = DIScope.getDirectory();
48 StringRef FileName = DIScope.getFilename();
49 SmallString<256> FullPath;
50 if (DirName != "." && DirName != "") {
51 FullPath = DirName;
52 }
53 if (FileName != "") {
54 sys::path::append(FullPath, FileName);
55 }
56 P = FullPath.str();
57 }
58 return P.c_str();
59 }
60 };
61
62 } // namespace jitprofiling
63
64 } // namespace llvm
65
66 #endif //EVENT_LISTENER_COMMON_H
0 //===-- JIT.h - Abstract Execution Engine Interface -------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Common functionality for JITEventListener implementations
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef EVENT_LISTENER_COMMON_H
14 #define EVENT_LISTENER_COMMON_H
15
16 #include "llvm/ADT/DenseMap.h"
17 #include "llvm/IR/DebugInfo.h"
18 #include "llvm/IR/Metadata.h"
19 #include "llvm/IR/ValueHandle.h"
20 #include "llvm/Support/Path.h"
21
22 namespace llvm {
23
24 namespace jitprofiling {
25
26 class FilenameCache {
27 // Holds the filename of each Scope, so that we can pass a null-terminated
28 // string into oprofile.
29 DenseMap Filenames;
30 DenseMap Paths;
31
32 public:
33 const char *getFilename(MDNode *Scope) {
34 assert(Scope->isResolved() && "Expected Scope to be resolved");
35 std::string &Filename = Filenames[Scope];
36 if (Filename.empty()) {
37 DIScope DIScope(Scope);
38 Filename = DIScope.getFilename();
39 }
40 return Filename.c_str();
41 }
42
43 const char *getFullPath(MDNode *Scope) {
44 assert(Scope->isResolved() && "Expected Scope to be resolved");
45 std::string &P = Paths[Scope];
46 if (P.empty()) {
47 DIScope DIScope(Scope);
48 StringRef DirName = DIScope.getDirectory();
49 StringRef FileName = DIScope.getFilename();
50 SmallString<256> FullPath;
51 if (DirName != "." && DirName != "") {
52 FullPath = DirName;
53 }
54 if (FileName != "") {
55 sys::path::append(FullPath, FileName);
56 }
57 P = FullPath.str();
58 }
59 return P.c_str();
60 }
61 };
62
63 } // namespace jitprofiling
64
65 } // namespace llvm
66
67 #endif //EVENT_LISTENER_COMMON_H
None if not config.root.llvm_use_intel_jitevents == "ON":
0 if not config.root.llvm_use_intel_jitevents == "true":
11 config.unsupported = True
22
0 ; Verify the behavior of the IntelJITEventListener.
1 ; RUN: llvm-jitlistener %s | FileCheck %s
2
3 ; This test was created using the following file:
4 ;
5 ; 1: int foo(int a) {
6 ; 2: return a;
7 ; 3: }
8 ; 4:
9 ; 5: int bar(int a) {
10 ; 6: if (a == 0) {
11 ; 7: return 0;
12 ; 8: }
13 ; 9: return 100/a;
14 ; 10: }
15 ; 11:
16 ; 12: int fubar(int a) {
17 ; 13: switch (a) {
18 ; 14: case 0:
19 ; 15: return 10;
20 ; 16: case 1:
21 ; 17: return 20;
22 ; 18: default:
23 ; 19: return 30;
24 ; 20: }
25 ; 21: }
26 ;
27
28 ; CHECK: Method load [1]: bar, Size = {{[0-9]+}}
29 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
30 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
31 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
32 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
33
34 ; CHECK: Method load [2]: foo, Size = {{[0-9]+}}
35 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
36 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
37
38 ; CHECK: Method load [3]: fubar, Size = {{[0-9]+}}
39 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
40 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
41 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
42 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
43 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
44
45 ; CHECK: Method unload [1]
46 ; CHECK: Method unload [2]
47 ; CHECK: Method unload [3]
48
49 ; ModuleID = 'multiple.c'
50
51 ; Function Attrs: nounwind uwtable
52 define i32 @foo(i32 %a) #0 {
53 entry:
54 %a.addr = alloca i32, align 4
55 store i32 %a, i32* %a.addr, align 4
56 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !16), !dbg !17
57 %0 = load i32* %a.addr, align 4, !dbg !18
58 ret i32 %0, !dbg !19
59 }
60
61 ; Function Attrs: nounwind readnone
62 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
63
64 ; Function Attrs: nounwind uwtable
65 define i32 @bar(i32 %a) #0 {
66 entry:
67 %retval = alloca i32, align 4
68 %a.addr = alloca i32, align 4
69 store i32 %a, i32* %a.addr, align 4
70 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !20, metadata !16), !dbg !21
71 %0 = load i32* %a.addr, align 4, !dbg !22
72 %cmp = icmp eq i32 %0, 0, !dbg !22
73 br i1 %cmp, label %if.then, label %if.end, !dbg !24
74
75 if.then: ; preds = %entry
76 store i32 0, i32* %retval, !dbg !25
77 br label %return, !dbg !25
78
79 if.end: ; preds = %entry
80 %1 = load i32* %a.addr, align 4, !dbg !27
81 %div = sdiv i32 100, %1, !dbg !28
82 store i32 %div, i32* %retval, !dbg !29
83 br label %return, !dbg !29
84
85 return: ; preds = %if.end, %if.then
86 %2 = load i32* %retval, !dbg !30
87 ret i32 %2, !dbg !30
88 }
89
90 ; Function Attrs: nounwind uwtable
91 define i32 @fubar(i32 %a) #0 {
92 entry:
93 %retval = alloca i32, align 4
94 %a.addr = alloca i32, align 4
95 store i32 %a, i32* %a.addr, align 4
96 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !31, metadata !16), !dbg !32
97 %0 = load i32* %a.addr, align 4, !dbg !33
98 switch i32 %0, label %sw.default [
99 i32 0, label %sw.bb
100 i32 1, label %sw.bb1
101 ], !dbg !34
102
103 sw.bb: ; preds = %entry
104 store i32 10, i32* %retval, !dbg !35
105 br label %return, !dbg !35
106
107 sw.bb1: ; preds = %entry
108 store i32 20, i32* %retval, !dbg !37
109 br label %return, !dbg !37
110
111 sw.default: ; preds = %entry
112 store i32 30, i32* %retval, !dbg !38
113 br label %return, !dbg !38
114
115 return: ; preds = %sw.default, %sw.bb1, %sw.bb
116 %1 = load i32* %retval, !dbg !39
117 ret i32 %1, !dbg !39
118 }
119
120 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
121 attributes #1 = { nounwind readnone }
122
123 !llvm.dbg.cu = !{!0}
124 !llvm.module.flags = !{!11, !12, !13}
125 !llvm.ident = !{!14}
126
127 !0 = !{!"0x11\0012\00clang version 3.6.0 (trunk)\000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c] [DW_LANG_C99]
128 !1 = !{!"multiple.c", !"F:\5Cusers\5Cakaylor\5Cllvm-s\5Cllvm\5Ctest\5CJitListener"}
129 !2 = !{}
130 !3 = !{!4, !9, !10}
131 !4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\000\00256\000\001", !1, !5, !6, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
132 !5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
133 !6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
134 !7 = !{!8, !8}
135 !8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
136 !9 = !{!"0x2e\00bar\00bar\00\005\000\001\000\000\00256\000\005", !1, !5, !6, null, i32 (i32)* @bar, null, null, !2} ; [ DW_TAG_subprogram ] [line 5] [def] [bar]
137 !10 = !{!"0x2e\00fubar\00fubar\00\0012\000\001\000\000\00256\000\0012", !1, !5, !6, null, i32 (i32)* @fubar, null, null, !2} ; [ DW_TAG_subprogram ] [line 12] [def] [fubar]
138 !11 = !{i32 2, !"Dwarf Version", i32 4}
139 !12 = !{i32 2, !"Debug Info Version", i32 2}
140 !13 = !{i32 1, !"PIC Level", i32 2}
141 !14 = !{!"clang version 3.6.0 (trunk)"}
142 !15 = !{!"0x101\00a\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 1]
143 !16 = !{!"0x102"} ; [ DW_TAG_expression ]
144 !17 = !{i32 1, i32 13, !4, null}
145 !18 = !{i32 2, i32 10, !4, null}
146 !19 = !{i32 2, i32 3, !4, null}
147 !20 = !{!"0x101\00a\0016777221\000", !9, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 5]
148 !21 = !{i32 5, i32 13, !9, null}
149 !22 = !{i32 6, i32 7, !23, null}
150 !23 = !{!"0xb\006\007\000", !1, !9} ; [ DW_TAG_lexical_block ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
151 !24 = !{i32 6, i32 7, !9, null}
152 !25 = !{i32 7, i32 5, !26, null}
153 !26 = !{!"0xb\006\0015\001", !1, !23} ; [ DW_TAG_lexical_block ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
154 !27 = !{i32 9, i32 14, !9, null}
155 !28 = !{i32 9, i32 10, !9, null}
156 !29 = !{i32 9, i32 3, !9, null}
157 !30 = !{i32 10, i32 1, !9, null}
158 !31 = !{!"0x101\00a\0016777228\000", !10, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 12]
159 !32 = !{i32 12, i32 15, !10, null}
160 !33 = !{i32 13, i32 11, !10, null}
161 !34 = !{i32 13, i32 3, !10, null}
162 !35 = !{i32 15, i32 7, !36, null}
163 !36 = !{!"0xb\0013\0014\002", !1, !10} ; [ DW_TAG_lexical_block ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
164 !37 = !{i32 17, i32 7, !36, null}
165 !38 = !{i32 19, i32 7, !36, null}
166 !39 = !{i32 21, i32 1, !10, null}
0 ; Verify the behavior of the IntelJITEventListener.
1 ; RUN: llvm-jitlistener %s | FileCheck %s
2
3 ; This test was created using the following file:
4 ;
5 ; 1: int foo(int a) {
6 ; 2: return a;
7 ; 3: }
8 ;
9
10 ; CHECK: Method load [1]: foo, Size = {{[0-9]+}}
11 ; CHECK: Line info @ {{[0-9]+}}: simple.c, line 1
12 ; CHECK: Line info @ {{[0-9]+}}: simple.c, line 2
13 ; CHECK: Method unload [1]
14
15 ; ModuleID = 'simple.c'
16
17 ; Function Attrs: nounwind uwtable
18 define i32 @foo(i32 %a) #0 {
19 entry:
20 %a.addr = alloca i32, align 4
21 store i32 %a, i32* %a.addr, align 4
22 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !12, metadata !13), !dbg !14
23 %0 = load i32* %a.addr, align 4, !dbg !15
24 ret i32 %0, !dbg !16
25 }
26
27 ; Function Attrs: nounwind readnone
28 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
29
30 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
31 attributes #1 = { nounwind readnone }
32
33 !llvm.dbg.cu = !{!0}
34 !llvm.module.flags = !{!9, !10}
35 !llvm.ident = !{!11}
36
37 !0 = !{!"0x11\0012\00clang version 3.6.0 (trunk)\000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/simple.c] [DW_LANG_C99]
38 !1 = !{!"simple.c", !"F:\5Cusers\5Cakaylor\5Cllvm-s\5Cllvm\5Ctest\5CJitListener"}
39 !2 = !{}
40 !3 = !{!4}
41 !4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\000\00256\000\001", !1, !5, !6, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
42 !5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/simple.c]
43 !6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
44 !7 = !{!8, !8}
45 !8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
46 !9 = !{i32 2, !"Dwarf Version", i32 4}
47 !10 = !{i32 2, !"Debug Info Version", i32 2}
48 !11 = !{!"clang version 3.6.0 (trunk)"}
49 !12 = !{!"0x101\00a\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 1]
50 !13 = !{!"0x102"} ; [ DW_TAG_expression ]
51 !14 = !{i32 1, i32 13, !4, null}
52 !15 = !{i32 2, i32 10, !4, null}
53 !16 = !{i32 2, i32 3, !4, null}
+0
-113
test/JitListener/test-common-symbols.ll less more
None ; RUN: llvm-jitlistener %s | FileCheck %s
1
2 ; CHECK: Method load [1]: main, Size = 164
3 ; CHECK: Method unload [1]
4
5 ; ModuleID = ''
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
8
9 @zero_int = common global i32 0, align 4
10 @zero_arr = common global [10 x i32] zeroinitializer, align 16
11 @zero_double = common global double 0.000000e+00, align 8
12
13 define i32 @main() nounwind uwtable {
14 entry:
15 %retval = alloca i32, align 4
16 %i = alloca i32, align 4
17 store i32 0, i32* %retval
18 %0 = load i32* @zero_int, align 4, !dbg !21
19 %add = add nsw i32 %0, 5, !dbg !21
20 %idxprom = sext i32 %add to i64, !dbg !21
21 %arrayidx = getelementptr inbounds [10 x i32]* @zero_arr, i32 0, i64 %idxprom, !dbg !21
22 store i32 40, i32* %arrayidx, align 4, !dbg !21
23 %1 = load double* @zero_double, align 8, !dbg !23
24 %cmp = fcmp olt double %1, 1.000000e+00, !dbg !23
25 br i1 %cmp, label %if.then, label %if.end, !dbg !23
26
27 if.then: ; preds = %entry
28 %2 = load i32* @zero_int, align 4, !dbg !24
29 %add1 = add nsw i32 %2, 2, !dbg !24
30 %idxprom2 = sext i32 %add1 to i64, !dbg !24
31 %arrayidx3 = getelementptr inbounds [10 x i32]* @zero_arr, i32 0, i64 %idxprom2, !dbg !24
32 store i32 70, i32* %arrayidx3, align 4, !dbg !24
33 br label %if.end, !dbg !24
34
35 if.end: ; preds = %if.then, %entry
36 call void @llvm.dbg.declare(metadata i32* %i, metadata !25, metadata !{!"0x102"}), !dbg !27
37 store i32 1, i32* %i, align 4, !dbg !28
38 br label %for.cond, !dbg !28
39
40 for.cond: ; preds = %for.inc, %if.end
41 %3 = load i32* %i, align 4, !dbg !28
42 %cmp4 = icmp slt i32 %3, 10, !dbg !28
43 br i1 %cmp4, label %for.body, label %for.end, !dbg !28
44
45 for.body: ; preds = %for.cond
46 %4 = load i32* %i, align 4, !dbg !29
47 %sub = sub nsw i32 %4, 1, !dbg !29
48 %idxprom5 = sext i32 %sub to i64, !dbg !29
49 %arrayidx6 = getelementptr inbounds [10 x i32]* @zero_arr, i32 0, i64 %idxprom5, !dbg !29
50 %5 = load i32* %arrayidx6, align 4, !dbg !29
51 %6 = load i32* %i, align 4, !dbg !29
52 %idxprom7 = sext i32 %6 to i64, !dbg !29
53 %arrayidx8 = getelementptr inbounds [10 x i32]* @zero_arr, i32 0, i64 %idxprom7, !dbg !29
54 %7 = load i32* %arrayidx8, align 4, !dbg !29
55 %add9 = add nsw i32 %5, %7, !dbg !29
56 %8 = load i32* %i, align 4, !dbg !29
57 %idxprom10 = sext i32 %8 to i64, !dbg !29
58 %arrayidx11 = getelementptr inbounds [10 x i32]* @zero_arr, i32 0, i64 %idxprom10, !dbg !29
59 store i32 %add9, i32* %arrayidx11, align 4, !dbg !29
60 br label %for.inc, !dbg !31
61
62 for.inc: ; preds = %for.body
63 %9 = load i32* %i, align 4, !dbg !32
64 %inc = add nsw i32 %9, 1, !dbg !32
65 store i32 %inc, i32* %i, align 4, !dbg !32
66 br label %for.cond, !dbg !32
67
68 for.end: ; preds = %for.cond
69 %10 = load i32* getelementptr inbounds ([10 x i32]* @zero_arr, i32 0, i64 9), align 4, !dbg !33
70 %cmp12 = icmp eq i32 %10, 110, !dbg !33
71 %cond = select i1 %cmp12, i32 0, i32 -1, !dbg !33
72 ret i32 %cond, !dbg !33
73 }
74
75 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
76
77 !llvm.dbg.cu = !{!0}
78 !llvm.module.flags = !{!35}
79
80 !0 = !{!"0x11\0012\00clang version 3.1 ()\001\00\000\00\000", !34, !1, !1, !3, !12, null} ; [ DW_TAG_compile_unit ]
81 !1 = !{i32 0}
82 !3 = !{!5}
83 !5 = !{!"0x2e\00main\00main\00\006\000\001\000\006\000\000\000", !34, !6, !7, null, i32 ()* @main, null, null, !10} ; [ DW_TAG_subprogram ]
84 !6 = !{!"0x29", !34} ; [ DW_TAG_file_type ]
85 !7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
86 !8 = !{!9}
87 !9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ]
88 !10 = !{!11}
89 !11 = !{!"0x24"} ; [ DW_TAG_base_type ]
90 !12 = !{!14, !15, !17}
91 !14 = !{!"0x34\00zero_int\00zero_int\00\001\000\001", null, !6, !9, i32* @zero_int, null} ; [ DW_TAG_variable ]
92 !15 = !{!"0x34\00zero_double\00zero_double\00\002\000\001", null, !6, !16, double* @zero_double, null} ; [ DW_TAG_variable ]
93 !16 = !{!"0x24\00double\000\0064\0064\000\000\004", null, null} ; [ DW_TAG_base_type ]
94 !17 = !{!"0x34\00zero_arr\00zero_arr\00\003\000\001", null, !6, !18, [10 x i32]* @zero_arr, null} ; [ DW_TAG_variable ]
95 !18 = !{!"0x1\00\000\00320\0032\000\000", null, !"", !9, !19, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 320, align 32, offset 0] [from int]
96 !19 = !{!20}
97 !20 = !{!"0x21\000\0010"} ; [ DW_TAG_subrange_type ]
98 !21 = !{i32 7, i32 5, !22, null}
99 !22 = !{!"0xb\006\001\000", !34, !5} ; [ DW_TAG_lexical_block ]
100 !23 = !{i32 9, i32 5, !22, null}
101 !24 = !{i32 10, i32 9, !22, null}
102 !25 = !{!"0x100\00i\0012\000", !26, !6, !9} ; [ DW_TAG_auto_variable ]
103 !26 = !{!"0xb\0012\005\001", !34, !22} ; [ DW_TAG_lexical_block ]
104 !27 = !{i32 12, i32 14, !26, null}
105 !28 = !{i32 12, i32 19, !26, null}
106 !29 = !{i32 13, i32 9, !30, null}
107 !30 = !{!"0xb\0012\0034\002", !34, !26} ; [ DW_TAG_lexical_block ]
108 !31 = !{i32 14, i32 5, !30, null}
109 !32 = !{i32 12, i32 29, !26, null}
110 !33 = !{i32 15, i32 5, !22, null}
111 !34 = !{!"test-common-symbols.c", !"/store/store/llvm/build"}
112 !35 = !{i32 1, !"Debug Info Version", i32 2}
+0
-212
test/JitListener/test-inline.ll less more
None ; RUN: llvm-jitlistener %s | FileCheck %s
1
2 ; CHECK: Method load [1]: _Z15test_parametersPfPA2_dR11char_structPPitm, Size = 170
3 ; CHECK: Line info @ 0: test-inline.cpp, line 33
4 ; CHECK: Line info @ 35: test-inline.cpp, line 34
5 ; CHECK: Line info @ 165: test-inline.cpp, line 35
6 ; CHECK: Method load [2]: _Z3foov, Size = 3
7 ; CHECK: Line info @ 0: test-inline.cpp, line 28
8 ; CHECK: Line info @ 2: test-inline.cpp, line 29
9 ; CHECK: Line info @ 3: test-inline.cpp, line 29
10 ; CHECK: Method load [3]: main, Size = 146
11 ; CHECK: Line info @ 0: test-inline.cpp, line 39
12 ; CHECK: Line info @ 21: test-inline.cpp, line 41
13 ; CHECK: Line info @ 39: test-inline.cpp, line 42
14 ; CHECK: Line info @ 60: test-inline.cpp, line 44
15 ; CHECK: Line info @ 80: test-inline.cpp, line 48
16 ; CHECK: Line info @ 90: test-inline.cpp, line 45
17 ; CHECK: Line info @ 95: test-inline.cpp, line 46
18 ; CHECK: Line info @ 114: test-inline.cpp, line 48
19 ; CHECK: Line info @ 141: test-inline.cpp, line 49
20 ; CHECK: Line info @ 146: test-inline.cpp, line 49
21 ; CHECK: Method unload [1]
22 ; CHECK: Method unload [2]
23 ; CHECK: Method unload [3]
24
25 ; ModuleID = 'test-inline.cpp'
26 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
27 target triple = "x86_64-unknown-linux-gnu"
28
29 %struct.char_struct = type { i8, [2 x i8] }
30
31 @compound_char = global %struct.char_struct zeroinitializer, align 1
32 @_ZZ4mainE1d = private unnamed_addr constant [2 x [2 x double]] [[2 x double] [double 0.000000e+00, double 1.000000e+00], [2 x double] [double 2.000000e+00, double 3.000000e+00]], align 16
33
34 define double @_Z15test_parametersPfPA2_dR11char_structPPitm(float* %pf, [2 x double]* %ppd, %struct.char_struct* %s, i32** %ppn, i16 zeroext %us, i64 %l) uwtable {
35 entry:
36 %pf.addr = alloca float*, align 8
37 %ppd.addr = alloca [2 x double]*, align 8
38 %s.addr = alloca %struct.char_struct*, align 8
39 %ppn.addr = alloca i32**, align 8
40 %us.addr = alloca i16, align 2
41 %l.addr = alloca i64, align 8
42 %result = alloca double, align 8
43 store float* %pf, float** %pf.addr, align 8
44 call void @llvm.dbg.declare(metadata float** %pf.addr, metadata !46, metadata !{!"0x102"}), !dbg !47
45 store [2 x double]* %ppd, [2 x double]** %ppd.addr, align 8
46 call void @llvm.dbg.declare(metadata [2 x double]** %ppd.addr, metadata !48, metadata !{!"0x102"}), !dbg !47
47 store %struct.char_struct* %s, %struct.char_struct** %s.addr, align 8
48 call void @llvm.dbg.declare(metadata %struct.char_struct** %s.addr, metadata !49, metadata !{!"0x102"}), !dbg !47
49 store i32** %ppn, i32*** %ppn.addr, align 8
50 call void @llvm.dbg.declare(metadata i32*** %ppn.addr, metadata !50, metadata !{!"0x102"}), !dbg !47
51 store i16 %us, i16* %us.addr, align 2
52 call void @llvm.dbg.declare(metadata i16* %us.addr, metadata !51, metadata !{!"0x102"}), !dbg !47
53 store i64 %l, i64* %l.addr, align 8
54 call void @llvm.dbg.declare(metadata i64* %l.addr, metadata !52, metadata !{!"0x102"}), !dbg !47
55 call void @llvm.dbg.declare(metadata double* %result, metadata !53, metadata !{!"0x102"}), !dbg !55
56 %0 = load float** %pf.addr, align 8, !dbg !55
57 %arrayidx = getelementptr inbounds float* %0, i64 0, !dbg !55
58 %1 = load float* %arrayidx, align 4, !dbg !55
59 %conv = fpext float %1 to double, !dbg !55
60 %2 = load [2 x double]** %ppd.addr, align 8, !dbg !55
61 %arrayidx1 = getelementptr inbounds [2 x double]* %2, i64 1, !dbg !55
62 %arrayidx2 = getelementptr inbounds [2 x double]* %arrayidx1, i32 0, i64 1, !dbg !55
63 %3 = load double* %arrayidx2, align 8, !dbg !55
64 %mul = fmul double %conv, %3, !dbg !55
65 %4 = load %struct.char_struct** %s.addr, align 8, !dbg !55
66 %c = getelementptr inbounds %struct.char_struct* %4, i32 0, i32 0, !dbg !55
67 %5 = load i8* %c, align 1, !dbg !55
68 %conv3 = sext i8 %5 to i32, !dbg !55
69 %conv4 = sitofp i32 %conv3 to double, !dbg !55
70 %mul5 = fmul double %mul, %conv4, !dbg !55
71 %6 = load i16* %us.addr, align 2, !dbg !55
72 %conv6 = zext i16 %6 to i32, !dbg !55
73 %conv7 = sitofp i32 %conv6 to double, !dbg !55
74 %mul8 = fmul double %mul5, %conv7, !dbg !55
75 %7 = load i64* %l.addr, align 8, !dbg !55
76 %conv9 = uitofp i64 %7 to double, !dbg !55
77 %mul10 = fmul double %mul8, %conv9, !dbg !55
78 %call = call i32 @_Z3foov(), !dbg !55
79 %conv11 = sitofp i32 %call to double, !dbg !55
80 %add = fadd double %mul10, %conv11, !dbg !55
81 store double %add, double* %result, align 8, !dbg !55
82 %8 = load double* %result, align 8, !dbg !56
83 ret double %8, !dbg !56
84 }
85
86 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
87
88 define linkonce_odr i32 @_Z3foov() nounwind uwtable inlinehint {
89 entry:
90 ret i32 0, !dbg !57
91 }
92
93 define i32 @main(i32 %argc, i8** %argv) uwtable {
94 entry:
95 %retval = alloca i32, align 4
96 %argc.addr = alloca i32, align 4
97 %argv.addr = alloca i8**, align 8
98 %s = alloca %struct.char_struct, align 1
99 %f = alloca float, align 4
100 %d = alloca [2 x [2 x double]], align 16
101 %result = alloca double, align 8
102 store i32 0, i32* %retval
103 store i32 %argc, i32* %argc.addr, align 4
104 call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !59, metadata !{!"0x102"}), !dbg !60
105 store i8** %argv, i8*** %argv.addr, align 8
106 call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !61, metadata !{!"0x102"}), !dbg !60
107 call void @llvm.dbg.declare(metadata %struct.char_struct* %s, metadata !62, metadata !{!"0x102"}), !dbg !64
108 call void @llvm.dbg.declare(metadata float* %f, metadata !65, metadata !{!"0x102"}), !dbg !66
109 store float 0.000000e+00, float* %f, align 4, !dbg !66
110 call void @llvm.dbg.declare(metadata [2 x [2 x double]]* %d, metadata !67, metadata !{!"0x102"}), !dbg !70
111 %0 = bitcast [2 x [2 x double]]* %d to i8*, !dbg !70
112 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ([2 x [2 x double]]* @_ZZ4mainE1d to i8*), i64 32, i32 16, i1 false), !dbg !70
113 %c = getelementptr inbounds %struct.char_struct* %s, i32 0, i32 0, !dbg !71
114 store i8 97, i8* %c, align 1, !dbg !71
115 %c2 = getelementptr inbounds %struct.char_struct* %s, i32 0, i32 1, !dbg !72
116 %arrayidx = getelementptr inbounds [2 x i8]* %c2, i32 0, i64 0, !dbg !72
117 store i8 48, i8* %arrayidx, align 1, !dbg !72
118 %c21 = getelementptr inbounds %struct.char_struct* %s, i32 0, i32 1, !dbg !73
119 %arrayidx2 = getelementptr inbounds [2 x i8]* %c21, i32 0, i64 1, !dbg !73
120 store i8 49, i8* %arrayidx2, align 1, !dbg !73
121 call void @llvm.dbg.declare(metadata double* %result, metadata !74, metadata !{!"0x102"}), !dbg !75
122 %arraydecay = getelementptr inbounds [2 x [2 x double]]* %d, i32 0, i32 0, !dbg !75
123 %call = call double @_Z15test_parametersPfPA2_dR11char_structPPitm(float* %f, [2 x double]* %arraydecay, %struct.char_struct* %s, i32** null, i16 zeroext 10, i64 42), !dbg !75
124 store double %call, double* %result, align 8, !dbg !75
125 %1 = load double* %result, align 8, !dbg !76
126 %cmp = fcmp oeq double %1, 0.000000e+00, !dbg !76
127 %cond = select i1 %cmp, i32 0, i32 -1, !dbg !76
128 ret i32 %cond, !dbg !76
129 }
130
131 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
132
133 !llvm.dbg.cu = !{!0}
134 !llvm.module.flags = !{!78}
135
136 !0 = !{!"0x11\004\00clang version 3.3 (ssh://akaylor@git-amr-1.devtools.intel.com:29418/ssg_llvm-clang2 gitosis@miro.kw.intel.com:clang.git 39450d0469e0d5589ad39fd0b20b5742750619a0) (ssh://akaylor@git-amr-1.devtools.intel.com:29418/ssg_llvm-llvm gitosis@miro.kw.intel.com:llvm.git 376642ed620ecae05b68c7bc81f79aeb2065abe0)\001\00\000\00\000", !77, !1, !1, !3, !43, null} ; [ DW_TAG_compile_unit ] [/home/akaylor/dev/test-inline.cpp] [DW_LANG_C_plus_plus]
137 !1 = !{i32 0}
138 !3 = !{!5, !35, !40}
139 !5 = !{!"0x2e\00test_parameters\00test_parameters\00_Z15test_parametersPfPA2_dR11char_structPPitm\0032\000\001\000\006\00256\000\0033", !77, !6, !7, null, double (float*, [2 x double]*, %struct.char_struct*, i32**, i16, i64)* @_Z15test_parametersPfPA2_dR11char_structPPitm, null, null, !1} ; [ DW_TAG_subprogram ] [line 32] [def] [scope 33] [test_parameters]
140 !6 = !{!"0x29", !77} ; [ DW_TAG_file_type ]
141 !7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
142 !8 = !{!9, !10, !12, !16, !29, !32, !33}
143 !9 = !{!"0x24\00double\000\0064\0064\000\000\004", null, null} ; [ DW_TAG_base_type ] [double] [line 0, size 64, align 64, offset 0, enc DW_ATE_float]
144 !10 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from float]
145 !11 = !{!"0x24\00float\000\0032\0032\000\000\004", null, null} ; [ DW_TAG_base_type ] [float] [line 0, size 32, align 32, offset 0, enc DW_ATE_float]
146 !12 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !13} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
147 !13 = !{!"0x1\00\000\00128\0064\000\000", null, !"", !9, !14, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 128, align 64, offset 0] [from double]
148 !14 = !{!15}
149 !15 = !{!"0x21\000\002"} ; [ DW_TAG_subrange_type ] [0, 1]
150 !16 = !{!"0x10\00\000\000\000\000\000", null, null, !17} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from char_struct]
151 !17 = !{!"0x13\00char_struct\0022\0024\008\000\000\000", !77, null, null, !18, null, null, null} ; [ DW_TAG_structure_type ] [char_struct] [line 22, size 24, align 8, offset 0] [def] [from ]
152 !18 = !{!19, !21, !23}
153 !19 = !{!"0xd\00c\0023\008\008\000\000", !77, !17, !20} ; [ DW_TAG_member ] [c] [line 23, size 8, align 8, offset 0] [from char]
154 !20 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
155 !21 = !{!"0xd\00c2\0024\0016\008\008\000", !77, !17, !22} ; [ DW_TAG_member ] [c2] [line 24, size 16, align 8, offset 8] [from ]
156 !22 = !{!"0x1\00\000\0016\008\000\000", null, !"", !20, !14, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 16, align 8, offset 0] [from char]
157 !23 = !{!"0x2e\00char_struct\00char_struct\00\0022\000\000\000\006\00320\000\0022", !77, !17, !24, null, null, null, i32 0, !27} ; [ DW_TAG_subprogram ] [line 22] [char_struct]
158 !24 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !25, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
159 !25 = !{null, !26}
160 !26 = !{!"0xf\00\000\0064\0064\000\001088", i32 0, !"", !17} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char_struct]
161 !27 = !{!28}
162 !28 = !{!"0x24"} ; [ DW_TAG_base_type ] [line 0, size 0, align 0, offset 0]
163 !29 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !30} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
164 !30 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !31} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int]
165 !31 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
166 !32 = !{!"0x24\00unsigned short\000\0016\0016\000\000\007", null, null} ; [ DW_TAG_base_type ] [unsigned short] [line 0, size 16, align 16, offset 0, enc DW_ATE_unsigned]
167 !33 = !{!"0x26\00\000\000\000\000\000", null, !"", !34} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from long unsigned int]
168 !34 = !{!"0x24\00long unsigned int\000\0064\0064\000\000\007", null, null} ; [ DW_TAG_base_type ] [long unsigned int] [line 0, size 64, align 64, offset 0, enc DW_ATE_unsigned]
169 !35 = !{!"0x2e\00main\00main\00\0038\000\001\000\006\00256\000\0039", !77, !6, !36, null, i32 (i32, i8**)* @main, null, null, !1} ; [ DW_TAG_subprogram ] [line 38] [def] [scope 39] [main]
170 !36 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !37, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
171 !37 = !{!31, !31, !38}
172 !38 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !39} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
173 !39 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !20} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char]
174 !40 = !{!"0x2e\00foo\00foo\00_Z3foov\0027\000\001\000\006\00256\000\0028", !77, !6, !41, null, i32 ()* @_Z3foov, null, null, !1} ; [ DW_TAG_subprogram ] [line 27] [def] [scope 28] [foo]
175 !41 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !42, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
176 !42 = !{!31}
177 !43 = !{!45}
178 !45 = !{!"0x34\00compound_char\00compound_char\00\0025\000\001", null, !6, !17, %struct.char_struct* @compound_char, null} ; [ DW_TAG_variable ] [compound_char] [line 25] [def]
179 !46 = !{!"0x101\00pf\0016777248\000", !5, !6, !10} ; [ DW_TAG_arg_variable ] [pf] [line 32]
180 !47 = !{i32 32, i32 0, !5, null}
181 !48 = !{!"0x101\00ppd\0033554464\000", !5, !6, !12} ; [ DW_TAG_arg_variable ] [ppd] [line 32]
182 !49 = !{!"0x101\00s\0050331680\000", !5, !6, !16} ; [ DW_TAG_arg_variable ] [s] [line 32]
183 !50 = !{!"0x101\00ppn\0067108896\000", !5, !6, !29} ; [ DW_TAG_arg_variable ] [ppn] [line 32]
184 !51 = !{!"0x101\00us\0083886112\000", !5, !6, !32} ; [ DW_TAG_arg_variable ] [us] [line 32]
185 !52 = !{!"0x101\00l\00100663328\000", !5, !6, !33} ; [ DW_TAG_arg_variable ] [l] [line 32]
186 !53 = !{!"0x100\00result\0034\000", !54, !6, !9} ; [ DW_TAG_auto_variable ] [result] [line 34]
187 !54 = !{!"0xb\0033\000\000", !77, !5} ; [ DW_TAG_lexical_block ] [/home/akaylor/dev/test-inline.cpp]
188 !55 = !{i32 34, i32 0, !54, null}
189 !56 = !{i32 35, i32 0, !54, null}
190 !57 = !{i32 29, i32 0, !58, null}
191 !58 = !{!"0xb\0028\000\002", !77, !40} ; [ DW_TAG_lexical_block ] [/home/akaylor/dev/test-inline.cpp]
192 !59 = !{!"0x101\00argc\0016777254\000", !35, !6, !31} ; [ DW_TAG_arg_variable ] [argc] [line 38]
193 !60 = !{i32 38, i32 0, !35, null}
194 !61 = !{!"0x101\00argv\0033554470\000", !35, !6, !38} ; [ DW_TAG_arg_variable ] [argv] [line 38]
195 !62 = !{!"0x100\00s\0040\000", !63, !6, !17} ; [ DW_TAG_auto_variable ] [s] [line 40]
196 !63 = !{!"0xb\0039\000\001", !77, !35} ; [ DW_TAG_lexical_block ] [/home/akaylor/dev/test-inline.cpp]
197 !64 = !{i32 40, i32 0, !63, null}
198 !65 = !{!"0x100\00f\0041\000", !63, !6, !11} ; [ DW_TAG_auto_variable ] [f] [line 41]
199 !66 = !{i32 41, i32 0, !63, null}
200 !67 = !{!"0x100\00d\0042\000", !63, !6, !68} ; [ DW_TAG_auto_variable ] [d] [line 42]
201 !68 = !{!"0x1\00\000\00256\0064\000\000", null, !"", !9, !69, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 256, align 64, offset 0] [from double]
202 !69 = !{!15, !15}
203 !70 = !{i32 42, i32 0, !63, null}
204 !71 = !{i32 44, i32 0, !63, null}
205 !72 = !{i32 45, i32 0, !63, null}
206 !73 = !{i32 46, i32 0, !63, null}
207 !74 = !{!"0x100\00result\0048\000", !63, !6, !9} ; [ DW_TAG_auto_variable ] [result] [line 48]
208 !75 = !{i32 48, i32 0, !63, null}
209 !76 = !{i32 49, i32 0, !63, null}
210 !77 = !{!"test-inline.cpp", !"/home/akaylor/dev"}
211 !78 = !{i32 1, !"Debug Info Version", i32 2}
+0
-211
test/JitListener/test-parameters.ll less more
None ; RUN: llvm-jitlistener %s | FileCheck %s
1
2 ; CHECK: Method load [1]: _Z15test_parametersPfPA2_dR11char_structPPitm, Size = 170
3 ; CHECK: Line info @ 0: test-parameters.cpp, line 33
4 ; CHECK: Line info @ 35: test-parameters.cpp, line 34
5 ; CHECK: Line info @ 165: test-parameters.cpp, line 35
6 ; CHECK: Method load [2]: _Z3foov, Size = 3
7 ; CHECK: Line info @ 0: test-parameters.cpp, line 28
8 ; CHECK: Line info @ 2: test-parameters.cpp, line 29
9 ; CHECK: Method load [3]: main, Size = 146
10 ; CHECK: Line info @ 0: test-parameters.cpp, line 39
11 ; CHECK: Line info @ 21: test-parameters.cpp, line 41
12 ; CHECK: Line info @ 39: test-parameters.cpp, line 42
13 ; CHECK: Line info @ 60: test-parameters.cpp, line 44
14 ; CHECK: Line info @ 80: test-parameters.cpp, line 48
15 ; CHECK: Line info @ 90: test-parameters.cpp, line 45
16 ; CHECK: Line info @ 95: test-parameters.cpp, line 46
17 ; CHECK: Line info @ 114: test-parameters.cpp, line 48
18 ; CHECK: Line info @ 141: test-parameters.cpp, line 49
19 ; CHECK: Line info @ 146: test-parameters.cpp, line 49
20 ; CHECK: Method unload [1]
21 ; CHECK: Method unload [2]
22 ; CHECK: Method unload [3]
23
24 ; ModuleID = 'test-parameters.cpp'
25 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
26 target triple = "x86_64-unknown-linux-gnu"
27
28 %struct.char_struct = type { i8, [2 x i8] }
29
30 @compound_char = global %struct.char_struct zeroinitializer, align 1
31 @_ZZ4mainE1d = private unnamed_addr constant [2 x [2 x double]] [[2 x double] [double 0.000000e+00, double 1.000000e+00], [2 x double] [double 2.000000e+00, double 3.000000e+00]], align 16
32
33 define i32 @_Z3foov() nounwind uwtable {
34 entry:
35 ret i32 0, !dbg !46
36 }
37
38 define double @_Z15test_parametersPfPA2_dR11char_structPPitm(float* %pf, [2 x double]* %ppd, %struct.char_struct* %s, i32** %ppn, i16 zeroext %us, i64 %l) nounwind uwtable {
39 entry:
40 %pf.addr = alloca float*, align 8
41 %ppd.addr = alloca [2 x double]*, align 8
42 %s.addr = alloca %struct.char_struct*, align 8
43 %ppn.addr = alloca i32**, align 8
44 %us.addr = alloca i16, align 2
45 %l.addr = alloca i64, align 8
46 %result = alloca double, align 8
47 store float* %pf, float** %pf.addr, align 8
48 call void @llvm.dbg.declare(metadata float** %pf.addr, metadata !48, metadata !{!"0x102"}), !dbg !49
49 store [2 x double]* %ppd, [2 x double]** %ppd.addr, align 8
50 call void @llvm.dbg.declare(metadata [2 x double]** %ppd.addr, metadata !50, metadata !{!"0x102"}), !dbg !49
51 store %struct.char_struct* %s, %struct.char_struct** %s.addr, align 8
52 call void @llvm.dbg.declare(metadata %struct.char_struct** %s.addr, metadata !51, metadata !{!"0x102"}), !dbg !49
53 store i32** %ppn, i32*** %ppn.addr, align 8
54 call void @llvm.dbg.declare(metadata i32*** %ppn.addr, metadata !52, metadata !{!"0x102"}), !dbg !49
55 store i16 %us, i16* %us.addr, align 2
56 call void @llvm.dbg.declare(metadata i16* %us.addr, metadata !53, metadata !{!"0x102"}), !dbg !49
57 store i64 %l, i64* %l.addr, align 8
58 call void @llvm.dbg.declare(metadata i64* %l.addr, metadata !54, metadata !{!"0x102"}), !dbg !49
59 call void @llvm.dbg.declare(metadata double* %result, metadata !55, metadata !{!"0x102"}), !dbg !57
60 %0 = load float** %pf.addr, align 8, !dbg !57
61 %arrayidx = getelementptr inbounds float* %0, i64 0, !dbg !57
62 %1 = load float* %arrayidx, align 4, !dbg !57
63 %conv = fpext float %1 to double, !dbg !57
64 %2 = load [2 x double]** %ppd.addr, align 8, !dbg !57
65 %arrayidx1 = getelementptr inbounds [2 x double]* %2, i64 1, !dbg !57
66 %arrayidx2 = getelementptr inbounds [2 x double]* %arrayidx1, i32 0, i64 1, !dbg !57
67 %3 = load double* %arrayidx2, align 8, !dbg !57
68 %mul = fmul double %conv, %3, !dbg !57
69 %4 = load %struct.char_struct** %s.addr, align 8, !dbg !57
70 %c = getelementptr inbounds %struct.char_struct* %4, i32 0, i32 0, !dbg !57
71 %5 = load i8* %c, align 1, !dbg !57
72 %conv3 = sext i8 %5 to i32, !dbg !57
73 %conv4 = sitofp i32 %conv3 to double, !dbg !57
74 %mul5 = fmul double %mul, %conv4, !dbg !57
75 %6 = load i16* %us.addr, align 2, !dbg !57
76 %conv6 = zext i16 %6 to i32, !dbg !57
77 %conv7 = sitofp i32 %conv6 to double, !dbg !57
78 %mul8 = fmul double %mul5, %conv7, !dbg !57
79 %7 = load i64* %l.addr, align 8, !dbg !57
80 %conv9 = uitofp i64 %7 to double, !dbg !57
81 %mul10 = fmul double %mul8, %conv9, !dbg !57
82 %call = call i32 @_Z3foov(), !dbg !57
83 %conv11 = sitofp i32 %call to double, !dbg !57
84 %add = fadd double %mul10, %conv11, !dbg !57
85 store double %add, double* %result, align 8, !dbg !57
86 %8 = load double* %result, align 8, !dbg !58
87 ret double %8, !dbg !58
88 }
89
90 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
91
92 define i32 @main(i32 %argc, i8** %argv) nounwind uwtable {
93 entry:
94 %retval = alloca i32, align 4
95 %argc.addr = alloca i32, align 4
96 %argv.addr = alloca i8**, align 8
97 %s = alloca %struct.char_struct, align 1
98 %f = alloca float, align 4
99 %d = alloca [2 x [2 x double]], align 16
100 %result = alloca double, align 8
101 store i32 0, i32* %retval
102 store i32 %argc, i32* %argc.addr, align 4
103 call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !59, metadata !{!"0x102"}), !dbg !60
104 store i8** %argv, i8*** %argv.addr, align 8
105 call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !61, metadata !{!"0x102"}), !dbg !60
106 call void @llvm.dbg.declare(metadata %struct.char_struct* %s, metadata !62, metadata !{!"0x102"}), !dbg !64
107 call void @llvm.dbg.declare(metadata float* %f, metadata !65, metadata !{!"0x102"}), !dbg !66
108 store float 0.000000e+00, float* %f, align 4, !dbg !66
109 call void @llvm.dbg.declare(metadata [2 x [2 x double]]* %d, metadata !67, metadata !{!"0x102"}), !dbg !70
110 %0 = bitcast [2 x [2 x double]]* %d to i8*, !dbg !70
111 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ([2 x [2 x double]]* @_ZZ4mainE1d to i8*), i64 32, i32 16, i1 false), !dbg !70
112 %c = getelementptr inbounds %struct.char_struct* %s, i32 0, i32 0, !dbg !71
113 store i8 97, i8* %c, align 1, !dbg !71
114 %c2 = getelementptr inbounds %struct.char_struct* %s, i32 0, i32 1, !dbg !72
115 %arrayidx = getelementptr inbounds [2 x i8]* %c2, i32 0, i64 0, !dbg !72
116 store i8 48, i8* %arrayidx, align 1, !dbg !72
117 %c21 = getelementptr inbounds %struct.char_struct* %s, i32 0, i32 1, !dbg !73
118 %arrayidx2 = getelementptr inbounds [2 x i8]* %c21, i32 0, i64 1, !dbg !73
119 store i8 49, i8* %arrayidx2, align 1, !dbg !73
120 call void @llvm.dbg.declare(metadata double* %result, metadata !74, metadata !{!"0x102"}), !dbg !75
121 %arraydecay = getelementptr inbounds [2 x [2 x double]]* %d, i32 0, i32 0, !dbg !75
122 %call = call double @_Z15test_parametersPfPA2_dR11char_structPPitm(float* %f, [2 x double]* %arraydecay, %struct.char_struct* %s, i32** null, i16 zeroext 10, i64 42), !dbg !75
123 store double %call, double* %result, align 8, !dbg !75
124 %1 = load double* %result, align 8, !dbg !76
125 %cmp = fcmp oeq double %1, 0.000000e+00, !dbg !76
126 %cond = select i1 %cmp, i32 0, i32 -1, !dbg !76
127 ret i32 %cond, !dbg !76
128 }
129
130 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
131
132 !llvm.dbg.cu = !{!0}
133 !llvm.module.flags = !{!78}
134
135 !0 = !{!"0x11\004\00clang version 3.3 (ssh://akaylor@git-amr-1.devtools.intel.com:29418/ssg_llvm-clang2 gitosis@miro.kw.intel.com:clang.git 39450d0469e0d5589ad39fd0b20b5742750619a0) (ssh://akaylor@git-amr-1.devtools.intel.com:29418/ssg_llvm-llvm gitosis@miro.kw.intel.com:llvm.git 376642ed620ecae05b68c7bc81f79aeb2065abe0)\001\00\000\00\000", !77, !1, !1, !3, !43, null} ; [ DW_TAG_compile_unit ] [/home/akaylor/dev/test-parameters.cpp] [DW_LANG_C_plus_plus]
136 !1 = !{i32 0}
137 !3 = !{!5, !10, !38}
138 !5 = !{!"0x2e\00foo\00foo\00_Z3foov\0027\000\001\000\006\00256\000\0028", !77, !6, !7, null, i32 ()* @_Z3foov, null, null, !1} ; [ DW_TAG_subprogram ] [line 27] [def] [scope 28] [foo]
139 !6 = !{!"0x29", !77} ; [ DW_TAG_file_type ]
140 !7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
141 !8 = !{!9}
142 !9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
143 !10 = !{!"0x2e\00test_parameters\00test_parameters\00_Z15test_parametersPfPA2_dR11char_structPPitm\0032\000\001\000\006\00256\000\0033", !77, !6, !11, null, double (float*, [2 x double]*, %struct.char_struct*, i32**, i16, i64)* @_Z15test_parametersPfPA2_dR11char_structPPitm, null, null, !1} ; [ DW_TAG_subprogram ] [line 32] [def] [scope 33] [test_parameters]
144 !11 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
145 !12 = !{!13, !14, !16, !20, !33, !35, !36}
146 !13 = !{!"0x24\00double\000\0064\0064\000\000\004", null, null} ; [ DW_TAG_base_type ] [double] [line 0, size 64, align 64, offset 0, enc DW_ATE_float]
147 !14 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !15} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from float]
148 !15 = !{!"0x24\00float\000\0032\0032\000\000\004", null, null} ; [ DW_TAG_base_type ] [float] [line 0, size 32, align 32, offset 0, enc DW_ATE_float]
149 !16 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !17} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
150 !17 = !{!"0x1\00\000\00128\0064\000\000", null, !"", !13, !18, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 128, align 64, offset 0] [from double]
151 !18 = !{!19}
152 !19 = !{!"0x21\000\002"} ; [ DW_TAG_subrange_type ] [0, 1]
153 !20 = !{!"0x10\00\000\000\000\000\000", null, null, !21} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from char_struct]
154 !21 = !{!"0x13\00char_struct\0022\0024\008\000\000\000", !77, null, null, !22, null, null, null} ; [ DW_TAG_structure_type ] [char_struct] [line 22, size 24, align 8, offset 0] [def] [from ]
155 !22 = !{!23, !25, !27}
156 !23 = !{!"0xd\00c\0023\008\008\000\000", !77, !21, !24} ; [ DW_TAG_member ] [c] [line 23, size 8, align 8, offset 0] [from char]
157 !24 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
158 !25 = !{!"0xd\00c2\0024\0016\008\008\000", !77, !21, !26} ; [ DW_TAG_member ] [c2] [line 24, size 16, align 8, offset 8] [from ]
159 !26 = !{!"0x1\00\000\0016\008\000\000", null, !"", !24, !18, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 16, align 8, offset 0] [from char]
160 !27 = !{!"0x2e\00char_struct\00char_struct\00\0022\000\000\000\006\00320\000\0022", !77, !21, !28, null, null, null, i32 0, !31} ; [ DW_TAG_subprogram ] [line 22] [char_struct]
161 !28 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !29, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
162 !29 = !{null, !30}
163 !30 = !{!"0xf\00\000\0064\0064\000\001088", i32 0, !"", !21} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char_struct]
164 !31 = !{!32}
165 !32 = !{!"0x24"} ; [ DW_TAG_base_type ] [line 0, size 0, align 0, offset 0]
166 !33 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !34} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
167 !34 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !9} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int]
168 !35 = !{!"0x24\00unsigned short\000\0016\0016\000\000\007", null, null} ; [ DW_TAG_base_type ] [unsigned short] [line 0, size 16, align 16, offset 0, enc DW_ATE_unsigned]
169 !36 = !{!"0x26\00\000\000\000\000\000", null, !"", !37} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from long unsigned int]
170 !37 = !{!"0x24\00long unsigned int\000\0064\0064\000\000\007", null, null} ; [ DW_TAG_base_type ] [long unsigned int] [line 0, size 64, align 64, offset 0, enc DW_ATE_unsigned]
171 !38 = !{!"0x2e\00main\00main\00\0038\000\001\000\006\00256\000\0039", !77, !6, !39, null, i32 (i32, i8**)* @main, null, null, !1} ; [ DW_TAG_subprogram ] [line 38] [def] [scope 39] [main]
172 !39 = !{!"0x15\00\000\000\000\000\000\000", i32 0, !"", null, !40, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
173 !40 = !{!9, !9, !41}
174 !41 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !42} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
175 !42 = !{!"0xf\00\000\0064\0064\000\000", null, !"", !24} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char]
176 !43 = !{!45}
177 !45 = !{!"0x34\00compound_char\00compound_char\00\0025\000\001", null, !6, !21, %struct.char_struct* @compound_char, null} ; [ DW_TAG_variable ] [compound_char] [line 25] [def]
178 !46 = !{i32 29, i32 0, !47, null}
179 !47 = !{!"0xb\0028\000\000", !77, !5} ; [ DW_TAG_lexical_block ] [/home/akaylor/dev/test-parameters.cpp]
180 !48 = !{!"0x101\00pf\0016777248\000", !10, !6, !14} ; [ DW_TAG_arg_variable ] [pf] [line 32]
181 !49 = !{i32 32, i32 0, !10, null}
182 !50 = !{!"0x101\00ppd\0033554464\000", !10, !6, !16} ; [ DW_TAG_arg_variable ] [ppd] [line 32]
183 !51 = !{!"0x101\00s\0050331680\000", !10, !6, !20} ; [ DW_TAG_arg_variable ] [s] [line 32]
184 !52 = !{!"0x101\00ppn\0067108896\000", !10, !6, !33} ; [ DW_TAG_arg_variable ] [ppn] [line 32]
185 !53 = !{!"0x101\00us\0083886112\000", !10, !6, !35} ; [ DW_TAG_arg_variable ] [us] [line 32]
186 !54 = !{!"0x101\00l\00100663328\000", !10, !6, !36} ; [ DW_TAG_arg_variable ] [l] [line 32]
187 !55 = !{!"0x100\00result\0034\000", !56, !6, !13} ; [ DW_TAG_auto_variable ] [result] [line 34]
188 !56 = !{!"0xb\0033\000\001", !77, !10} ; [ DW_TAG_lexical_block ] [/home/akaylor/dev/test-parameters.cpp]
189 !57 = !{i32 34, i32 0, !56, null}
190 !58 = !{i32 35, i32 0, !56, null}
191 !59 = !{!"0x101\00argc\0016777254\000", !38, !6, !9} ; [ DW_TAG_arg_variable ] [argc] [line 38]
192 !60 = !{i32 38, i32 0, !38, null}
193 !61 = !{!"0x101\00argv\0033554470\000", !38, !6, !41} ; [ DW_TAG_arg_variable ] [argv] [line 38]
194 !62 = !{!"0x100\00s\0040\000", !63, !6, !21} ; [ DW_TAG_auto_variable ] [s] [line 40]
195 !63 = !{!"0xb\0039\000\002", !77, !38} ; [ DW_TAG_lexical_block ] [/home/akaylor/dev/test-parameters.cpp]
196 !64 = !{i32 40, i32 0, !63, null}
197 !65 = !{!"0x100\00f\0041\000", !63, !6, !15} ; [ DW_TAG_auto_variable ] [f] [line 41]
198 !66 = !{i32 41, i32 0, !63, null}
199 !67 = !{!"0x100\00d\0042\000", !63, !6, !68} ; [ DW_TAG_auto_variable ] [d] [line 42]
200 !68 = !{!"0x1\00\000\00256\0064\000\000", null, !"", !13, !69, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 256, align 64, offset 0] [from double]
201 !69 = !{!19, !19}
202 !70 = !{i32 42, i32 0, !63, null}
203 !71 = !{i32 44, i32 0, !63, null}
204 !72 = !{i32 45, i32 0, !63, null}
205 !73 = !{i32 46, i32 0, !63, null}
206 !74 = !{!"0x100\00result\0048\000", !63, !6, !13} ; [ DW_TAG_auto_variable ] [result] [line 48]
207 !75 = !{i32 48, i32 0, !63, null}
208 !76 = !{i32 49, i32 0, !63, null}
209 !77 = !{!"test-parameters.cpp", !"/home/akaylor/dev"}
210 !78 = !{i32 1, !"Debug Info Version", i32 2}