• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -start-after machine-cp -stop-after=if-converter -mtriple=thumbv7 %s -o /dev/null 2>&1 | FileCheck %s
2--- |
3  ; ModuleID = '/Volumes/Data/llvm/test/CodeGen/ARM/sched-it-debug-nodes.ll'
4  target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
5  target triple = "thumbv7"
6
7  %struct.s = type opaque
8
9  ; Function Attrs: nounwind
10  define arm_aapcscc i32 @f(%struct.s* %s, i32 %u, i8* %b, i32 %n) #0 !dbg !4 {
11  entry:
12    tail call void @llvm.dbg.value(metadata %struct.s* %s, i64 0, metadata !18, metadata !27), !dbg !28
13    tail call void @llvm.dbg.value(metadata i32 %u, i64 0, metadata !19, metadata !27), !dbg !28
14    tail call void @llvm.dbg.value(metadata i8* %b, i64 0, metadata !20, metadata !27), !dbg !28
15    tail call void @llvm.dbg.value(metadata i32 %n, i64 0, metadata !21, metadata !27), !dbg !28
16    %cmp = icmp ult i32 %n, 4, !dbg !29
17    br i1 %cmp, label %return, label %if.end, !dbg !31
18
19  if.end:                                           ; preds = %entry
20    tail call arm_aapcscc void @g(%struct.s* %s, i8* %b, i32 %n) #3, !dbg !32
21    br label %return, !dbg !33
22
23  return:                                           ; preds = %if.end, %entry
24    %retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
25    ret i32 %retval.0, !dbg !34
26  }
27
28  declare arm_aapcscc void @g(%struct.s*, i8*, i32) #1
29
30  ; Function Attrs: nounwind readnone
31  declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
32
33  attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
34  attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
35  attributes #2 = { nounwind readnone }
36  attributes #3 = { nounwind }
37
38  !llvm.dbg.cu = !{!0}
39  !llvm.module.flags = !{!22, !23, !24, !25}
40  !llvm.ident = !{!26}
41
42  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0  (llvm/trunk 237059)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
43  !1 = !DIFile(filename: "<stdin>", directory: "/Users/compnerd/Source/llvm")
44  !2 = !{}
45  !3 = !{!4}
46  !4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !17)
47  !5 = !DISubroutineType(types: !6)
48  !6 = !{!7, !8, !11, !12, !16}
49  !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
50  !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 32, align: 32)
51  !9 = !DIDerivedType(tag: DW_TAG_typedef, name: "s", file: !1, line: 5, baseType: !10)
52  !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", file: !1, line: 5, flags: DIFlagFwdDecl)
53  !11 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
54  !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 32, align: 32)
55  !13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14)
56  !14 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !1, line: 2, baseType: !15)
57  !15 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
58  !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", file: !1, line: 3, baseType: !11)
59  !17 = !{!18, !19, !20, !21}
60  !18 = !DILocalVariable(name: "s", arg: 1, scope: !4, file: !1, line: 9, type: !8)
61  !19 = !DILocalVariable(name: "u", arg: 2, scope: !4, file: !1, line: 9, type: !11)
62  !20 = !DILocalVariable(name: "b", arg: 3, scope: !4, file: !1, line: 9, type: !12)
63  !21 = !DILocalVariable(name: "n", arg: 4, scope: !4, file: !1, line: 9, type: !16)
64  !22 = !{i32 2, !"Dwarf Version", i32 4}
65  !23 = !{i32 2, !"Debug Info Version", i32 3}
66  !24 = !{i32 1, !"wchar_size", i32 4}
67  !25 = !{i32 1, !"min_enum_size", i32 4}
68  !26 = !{!"clang version 3.7.0  (llvm/trunk 237059)"}
69  !27 = !DIExpression()
70  !28 = !DILocation(line: 9, scope: !4)
71  !29 = !DILocation(line: 10, scope: !30)
72  !30 = distinct !DILexicalBlock(scope: !4, file: !1, line: 10)
73  !31 = !DILocation(line: 10, scope: !4)
74  !32 = !DILocation(line: 13, scope: !4)
75  !33 = !DILocation(line: 14, scope: !4)
76  !34 = !DILocation(line: 15, scope: !4)
77
78...
79---
80name:            f
81alignment:       1
82exposesReturnsTwice: false
83hasInlineAsm:    false
84isSSA:           false
85tracksRegLiveness: true
86tracksSubRegLiveness: false
87liveins:
88  - { reg: '%r0' }
89  - { reg: '%r2' }
90  - { reg: '%r3' }
91calleeSavedRegisters: [ '%lr', '%d8', '%d9', '%d10', '%d11', '%d12', '%d13',
92                        '%d14', '%d15', '%q4', '%q5', '%q6', '%q7', '%r4',
93                        '%r5', '%r6', '%r7', '%r8', '%r9', '%r10', '%r11',
94                        '%s16', '%s17', '%s18', '%s19', '%s20', '%s21',
95                        '%s22', '%s23', '%s24', '%s25', '%s26', '%s27',
96                        '%s28', '%s29', '%s30', '%s31', '%d8_d10', '%d9_d11',
97                        '%d10_d12', '%d11_d13', '%d12_d14', '%d13_d15',
98                        '%q4_q5', '%q5_q6', '%q6_q7', '%q4_q5_q6_q7', '%r4_r5',
99                        '%r6_r7', '%r8_r9', '%r10_r11', '%d8_d9_d10', '%d9_d10_d11',
100                        '%d10_d11_d12', '%d11_d12_d13', '%d12_d13_d14',
101                        '%d13_d14_d15', '%d8_d10_d12', '%d9_d11_d13', '%d10_d12_d14',
102                        '%d11_d13_d15', '%d8_d10_d12_d14', '%d9_d11_d13_d15',
103                        '%d9_d10', '%d11_d12', '%d13_d14', '%d9_d10_d11_d12',
104                        '%d11_d12_d13_d14' ]
105frameInfo:
106  isFrameAddressTaken: false
107  isReturnAddressTaken: false
108  hasStackMap:     false
109  hasPatchPoint:   false
110  stackSize:       8
111  offsetAdjustment: 0
112  maxAlignment:    4
113  adjustsStack:    true
114  hasCalls:        true
115  maxCallFrameSize: 0
116  hasOpaqueSPAdjustment: false
117  hasVAStart:      false
118  hasMustTailInVarArgFunc: false
119  savePoint:       '%bb.2.if.end'
120  restorePoint:    '%bb.2.if.end'
121stack:
122  - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '%lr' }
123  - { id: 1, type: spill-slot, offset: -8, size: 4, alignment: 4, callee-saved-register: '%r7' }
124body:             |
125  bb.0.entry:
126    successors: %bb.1, %bb.2.if.end
127    liveins: %r0, %r2, %r3, %lr, %r7
128
129    DBG_VALUE debug-use %r0, debug-use _, !18, !27, debug-location !28
130    DBG_VALUE debug-use %r1, debug-use _, !19, !27, debug-location !28
131    DBG_VALUE debug-use %r2, debug-use _, !20, !27, debug-location !28
132    DBG_VALUE debug-use %r3, debug-use _, !21, !27, debug-location !28
133    t2CMPri %r3, 4, 14, _, implicit-def %cpsr, debug-location !31
134    t2Bcc %bb.2.if.end, 2, killed %cpsr
135
136  bb.1:
137    liveins: %lr, %r7
138
139    DBG_VALUE debug-use %r1, debug-use _, !19, !27, debug-location !28
140    %r0 = t2MOVi -1, 14, _, _
141    DBG_VALUE debug-use %r1, debug-use _, !19, !27, debug-location !28
142    tBX_RET 14, _, implicit %r0, debug-location !34
143
144  bb.2.if.end:
145    liveins: %r0, %r2, %r3, %r7, %lr
146
147    %sp = frame-setup t2STMDB_UPD %sp, 14, _, killed %r7, killed %lr
148    frame-setup CFI_INSTRUCTION .cfi_def_cfa_offset 8
149    frame-setup CFI_INSTRUCTION .cfi_offset %lr, -4
150    frame-setup CFI_INSTRUCTION .cfi_offset %r7, -8
151    DBG_VALUE debug-use %r0, debug-use _, !18, !27, debug-location !28
152    DBG_VALUE debug-use %r1, debug-use _, !19, !27, debug-location !28
153    DBG_VALUE debug-use %r2, debug-use _, !20, !27, debug-location !28
154    DBG_VALUE debug-use %r3, debug-use _, !21, !27, debug-location !28
155    %r1 = COPY killed %r2, debug-location !32
156    %r2 = COPY killed %r3, debug-location !32
157    tBL 14, _, @g, csr_aapcs, implicit-def dead %lr, implicit %sp, implicit %r0, implicit %r1, implicit %r2, implicit-def %sp, debug-location !32
158    %r0 = t2MOVi 0, 14, _, _
159    %sp = t2LDMIA_UPD %sp, 14, _, def %r7, def %lr
160    DBG_VALUE debug-use %r1, debug-use _, !19, !27, debug-location !28
161    tBX_RET 14, _, implicit %r0, debug-location !34
162# Verify that the DBG_VALUE is ignored.
163# CHECK: %sp = t2LDMIA_RET %sp, 14, _, def %r7, def %pc, implicit %r0
164
165...
166