1 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
2 target triple = "x86_64-unknown-linux-gnu"
4 @factor = dso_local global i32 3
6 define dso_local i32 @funcA.llvm.1000(i32 %x) !dbg !12 {
8 call void @llvm.dbg.value(metadata i32 %x, metadata !16, metadata !DIExpression()), !dbg !18
9 call void @llvm.dbg.value(metadata i32 %x, metadata !19, metadata !DIExpression()), !dbg !22
10 %0 = load volatile i32, ptr @factor, align 4, !dbg !24, !tbaa !25
11 call void @llvm.dbg.value(metadata i32 %0, metadata !29, metadata !DIExpression()), !dbg !32
12 %cmp.i.i = icmp slt i32 %0, 3, !dbg !34
13 %add.i.i = add nsw i32 %0, 3, !dbg !36
14 %retval.0.i.i = select i1 %cmp.i.i, i32 %0, i32 %add.i.i, !dbg !36
15 %sub.i = sub nsw i32 %x, %retval.0.i.i, !dbg !37
16 call void @llvm.dbg.value(metadata i32 %sub.i, metadata !19, metadata !DIExpression()), !dbg !22
17 call void @llvm.dbg.value(metadata i32 %sub.i, metadata !17, metadata !DIExpression()), !dbg !18
18 ret i32 %sub.i, !dbg !38
21 define dso_local i32 @funcLeaf(i32 %x) !dbg !20 {
23 call void @llvm.dbg.value(metadata i32 %x, metadata !19, metadata !DIExpression()), !dbg !39
24 %0 = load volatile i32, ptr @factor, align 4, !dbg !40, !tbaa !25
25 call void @llvm.dbg.value(metadata i32 %0, metadata !29, metadata !DIExpression()), !dbg !41
26 %cmp.i = icmp slt i32 %0, 3, !dbg !43
27 %add.i = add nsw i32 %0, 3, !dbg !44
28 %retval.0.i = select i1 %cmp.i, i32 %0, i32 %add.i, !dbg !44
29 %sub = sub nsw i32 %x, %retval.0.i, !dbg !45
30 call void @llvm.dbg.value(metadata i32 %sub, metadata !19, metadata !DIExpression()), !dbg !39
31 ret i32 %sub, !dbg !46
34 define dso_local i32 @fib(i32 %x) !dbg !30 {
36 call void @llvm.dbg.value(metadata i32 %x, metadata !29, metadata !DIExpression()), !dbg !47
37 %cmp = icmp slt i32 %x, 3, !dbg !48
38 %add = add nsw i32 %x, 3, !dbg !49
39 %retval.0 = select i1 %cmp, i32 %x, i32 %add, !dbg !49
40 ret i32 %retval.0, !dbg !50
43 declare void @llvm.dbg.value(metadata, metadata, metadata) #2
46 !llvm.module.flags = !{!8, !9, !10}
48 !1 = distinct !DIGlobalVariable(name: "factor", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
49 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, emissionKind: FullDebug)
50 !3 = !DIFile(filename: "test.c", directory: "test")
52 !6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
53 !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
54 !8 = !{i32 7, !"Dwarf Version", i32 4}
55 !9 = !{i32 2, !"Debug Info Version", i32 3}
56 !10 = !{i32 1, !"wchar_size", i32 4}
57 !12 = distinct !DISubprogram(name: "funcA.llvm.1000", scope: !3, file: !3, line: 6, type: !13, scopeLine: 6, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !15)
58 !13 = !DISubroutineType(types: !14)
61 !16 = !DILocalVariable(name: "x", arg: 1, scope: !12, file: !3, line: 6, type: !7)
62 !17 = !DILocalVariable(name: "r", scope: !12, file: !3, line: 7, type: !7)
63 !18 = !DILocation(line: 0, scope: !12)
64 !19 = !DILocalVariable(name: "x", arg: 1, scope: !20, file: !3, line: 22, type: !7)
65 !20 = distinct !DISubprogram(name: "funcLeaf", scope: !3, file: !3, line: 22, type: !13, scopeLine: 23, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !21)
67 !22 = !DILocation(line: 0, scope: !20, inlinedAt: !23)
68 !23 = distinct !DILocation(line: 7, column: 11, scope: !12)
69 !24 = !DILocation(line: 24, column: 12, scope: !20, inlinedAt: !23)
70 !25 = !{!26, !26, i64 0}
71 !26 = !{!"int", !27, i64 0}
72 !27 = !{!"omnipotent char", !28, i64 0}
73 !28 = !{!"Simple C/C++ TBAA"}
74 !29 = !DILocalVariable(name: "x", arg: 1, scope: !30, file: !3, line: 11, type: !7)
75 !30 = distinct !DISubprogram(name: "fib", scope: !3, file: !3, line: 11, type: !13, scopeLine: 12, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !31)
77 !32 = !DILocation(line: 0, scope: !30, inlinedAt: !33)
78 !33 = distinct !DILocation(line: 24, column: 8, scope: !20, inlinedAt: !23)
79 !34 = !DILocation(line: 13, column: 9, scope: !35, inlinedAt: !33)
80 !35 = distinct !DILexicalBlock(scope: !30, file: !3, line: 13, column: 7)
81 !36 = !DILocation(line: 13, column: 7, scope: !30, inlinedAt: !33)
82 !37 = !DILocation(line: 24, column: 5, scope: !20, inlinedAt: !23)
83 !38 = !DILocation(line: 8, column: 3, scope: !12)
84 !39 = !DILocation(line: 0, scope: !20)
85 !40 = !DILocation(line: 24, column: 12, scope: !20)
86 !41 = !DILocation(line: 0, scope: !30, inlinedAt: !42)
87 !42 = distinct !DILocation(line: 24, column: 8, scope: !20)
88 !43 = !DILocation(line: 13, column: 9, scope: !35, inlinedAt: !42)
89 !44 = !DILocation(line: 13, column: 7, scope: !30, inlinedAt: !42)
90 !45 = !DILocation(line: 24, column: 5, scope: !20)
91 !46 = !DILocation(line: 25, column: 3, scope: !20)
92 !47 = !DILocation(line: 0, scope: !30)
93 !48 = !DILocation(line: 13, column: 9, scope: !35)
94 !49 = !DILocation(line: 13, column: 7, scope: !30)
95 !50 = !DILocation(line: 19, column: 1, scope: !30)