77target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
88target triple = "nvptx64-nvidia-cuda"
99
10- define void @h () !dbg !3 {
10+ define void @h () !dbg !100 {
1111entry:
1212 ; CHECK: remark: test.c:0:0: in artificial function 'h', artificial alloca ('%dyn_ptr.addr') for 'dyn_ptr' with static size of 8 bytes
1313 %dyn_ptr.addr = alloca ptr , align 8
1414 ; CHECK: remark: test.c:14:9: in artificial function 'h', alloca ('%i') for 'i' with static size of 4 bytes
1515 %i = alloca i32 , align 4
1616 ; CHECK: remark: test.c:15:9: in artificial function 'h', alloca ('%a') for 'a' with static size of 8 bytes
1717 %a = alloca [2 x i32 ], align 4
18+ %size = load i32 , ptr %i , align 4
19+ ; CHECK: remark: test.c:16:9: in artificial function 'h', alloca ('%adyn') for 'adyn' with dynamic size
20+ %adyn = alloca i32 , i32 %size , align 4
1821 ; CHECK: remark: <unknown>:0:0: in artificial function 'h', alloca ('%nodbg') without debug info with static size of 4 bytes
1922 %nodbg = alloca i32 , align 4
20- tail call void @llvm.dbg.declare (metadata ptr %dyn_ptr.addr , metadata !7 , metadata !DIExpression ()), !dbg !11
21- tail call void @llvm.dbg.declare (metadata ptr %i , metadata !12 , metadata !DIExpression ()), !dbg !15
22- tail call void @llvm.dbg.declare (metadata ptr %a , metadata !16 , metadata !DIExpression ()), !dbg !20
23+ tail call void @llvm.dbg.declare (metadata ptr %dyn_ptr.addr , metadata !110 , metadata !DIExpression ()), !dbg !114
24+ tail call void @llvm.dbg.declare (metadata ptr %i , metadata !120 , metadata !DIExpression ()), !dbg !121
25+ tail call void @llvm.dbg.declare (metadata ptr %a , metadata !130 , metadata !DIExpression ()), !dbg !131
26+ tail call void @llvm.dbg.declare (metadata ptr %adyn , metadata !140 , metadata !DIExpression ()), !dbg !141
27+ br label %non-entry
28+
29+ non-entry:
30+ ; CHECK: remark: test.c:17:9: in artificial function 'h', alloca ('%i2') for 'i2' with static size of 4 bytes
31+ %i2 = alloca i32 , align 4
32+ %size2 = load i32 , ptr %i2 , align 4
33+ ; CHECK: remark: test.c:18:9: in artificial function 'h', alloca ('%adyn2') for 'adyn2' with dynamic size
34+ %adyn2 = alloca i32 , i32 %size , align 4
35+ tail call void @llvm.dbg.declare (metadata ptr %i2 , metadata !150 , metadata !DIExpression ()), !dbg !151
36+ tail call void @llvm.dbg.declare (metadata ptr %adyn2 , metadata !160 , metadata !DIExpression ()), !dbg !161
2337 ret void
2438}
25- ; CHECK: remark: test.c:13:0: in artificial function 'h', Allocas = 4
26- ; CHECK: remark: test.c:13:0: in artificial function 'h', AllocasStaticSizeSum = 24
27- ; CHECK: remark: test.c:13:0: in artificial function 'h', AllocasDyn = 0
39+ ; CHECK: remark: test.c:13:0: in artificial function 'h', Allocas = 7
40+ ; CHECK: remark: test.c:13:0: in artificial function 'h', AllocasStaticSizeSum = 28
41+ ; CHECK: remark: test.c:13:0: in artificial function 'h', AllocasDyn = 2
2842
29- define void @g () !dbg !21 {
43+ define void @g () !dbg !200 {
3044entry:
3145 ; CHECK: remark: test.c:4:7: in function 'g', alloca ('%i') for 'i' with static size of 4 bytes
3246 %i = alloca i32 , align 4
3347 ; CHECK: remark: test.c:5:7: in function 'g', alloca ('%a') for 'a' with static size of 8 bytes
3448 %a = alloca [2 x i32 ], align 4
35- tail call void @llvm.dbg.declare (metadata ptr %i , metadata !23 , metadata !DIExpression ()), !dbg !24
36- tail call void @llvm.dbg.declare (metadata ptr %a , metadata !25 , metadata !DIExpression ()), !dbg !26
49+ tail call void @llvm.dbg.declare (metadata ptr %i , metadata !210 , metadata !DIExpression ()), !dbg !211
50+ tail call void @llvm.dbg.declare (metadata ptr %a , metadata !220 , metadata !DIExpression ()), !dbg !221
3751 ret void
3852}
3953; CHECK: remark: test.c:3:0: in function 'g', Allocas = 2
4458declare void @llvm.dbg.declare (metadata , metadata , metadata ) #0
4559
4660; uselistorder directives
47- uselistorder ptr @llvm.dbg.declare , { 4 , 3 , 2 , 1 , 0 }
61+ uselistorder ptr @llvm.dbg.declare , { 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 }
4862
4963attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
5064
@@ -54,27 +68,50 @@ attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memo
5468!0 = !{i32 2 , !"Debug Info Version" , i32 3 }
5569!1 = distinct !DICompileUnit (language: DW_LANG_C11, file: !2 , producer: "clang version 19.0.0git" , isOptimized: false , runtimeVersion: 0 , emissionKind: FullDebug, splitDebugInlining: false , nameTableKind: None)
5670!2 = !DIFile (filename: "test.c" , directory: "/tmp" )
57- !3 = distinct !DISubprogram (name: "h" , scope: !2 , file: !2 , line: 13 , type: !4 , scopeLine: 13 , flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1 , retainedNodes: !6 )
58- !4 = distinct !DISubroutineType (types: !5 )
59- !5 = !{null }
60- !6 = !{}
61- !7 = !DILocalVariable (name: "dyn_ptr" , arg: 1 , scope: !3 , type: !8 , flags: DIFlagArtificial)
62- !8 = !DIDerivedType (tag: DW_TAG_const_type, baseType: !9 )
63- !9 = !DIDerivedType (tag: DW_TAG_restrict_type, baseType: !10 )
64- !10 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: null , size: 64 )
65- !11 = !DILocation (line: 0 , scope: !3 )
66- !12 = !DILocalVariable (name: "i" , scope: !13 , file: !2 , line: 14 , type: !14 )
67- !13 = distinct !DILexicalBlock (scope: !3 , file: !2 , line: 13 , column: 3 )
68- !14 = !DIBasicType (name: "int" , size: 32 , encoding: DW_ATE_signed)
69- !15 = !DILocation (line: 14 , column: 9 , scope: !13 )
70- !16 = !DILocalVariable (name: "a" , scope: !13 , file: !2 , line: 15 , type: !17 )
71- !17 = !DICompositeType (tag: DW_TAG_array_type, baseType: !14 , size: 64 , elements: !18 )
72- !18 = !{!19 }
73- !19 = !DISubrange (count: 2 )
74- !20 = !DILocation (line: 15 , column: 9 , scope: !13 )
75- !21 = distinct !DISubprogram (name: "g" , scope: !2 , file: !2 , line: 3 , type: !22 , scopeLine: 3 , spFlags: DISPFlagDefinition, unit: !1 , retainedNodes: !6 )
76- !22 = !DISubroutineType (types: !5 )
77- !23 = !DILocalVariable (name: "i" , scope: !21 , file: !2 , line: 4 , type: !14 )
78- !24 = !DILocation (line: 4 , column: 7 , scope: !21 )
79- !25 = !DILocalVariable (name: "a" , scope: !21 , file: !2 , line: 5 , type: !17 )
80- !26 = !DILocation (line: 5 , column: 7 , scope: !21 )
71+ !3 = !{null }
72+ !4 = !{}
73+
74+ !10 = !DIBasicType (name: "int" , size: 32 , encoding: DW_ATE_signed)
75+
76+ !20 = !DIDerivedType (tag: DW_TAG_const_type, baseType: !21 )
77+ !21 = !DIDerivedType (tag: DW_TAG_restrict_type, baseType: !22 )
78+ !22 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: null , size: 64 )
79+
80+ !30 = !DICompositeType (tag: DW_TAG_array_type, baseType: !10 , size: 64 , elements: !31 )
81+ !31 = !{!32 }
82+ !32 = !DISubrange (count: 2 )
83+
84+ !40 = !DICompositeType (tag: DW_TAG_array_type, baseType: !10 , elements: !41 )
85+ !41 = !{!42 }
86+ !42 = !DISubrange (count: !43 )
87+ !43 = !DILocalVariable (name: "__vla_expr0" , scope: !100 , type: !10 , flags: DIFlagArtificial)
88+
89+ !100 = distinct !DISubprogram (name: "h" , scope: !2 , file: !2 , line: 13 , type: !101 , scopeLine: 13 , flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1 , retainedNodes: !4 )
90+ !101 = distinct !DISubroutineType (types: !3 )
91+
92+ !110 = !DILocalVariable (name: "dyn_ptr" , arg: 1 , scope: !100 , type: !20 , flags: DIFlagArtificial)
93+ !114 = !DILocation (line: 0 , scope: !100 )
94+
95+ !120 = !DILocalVariable (name: "i" , scope: !100 , file: !2 , line: 14 , type: !10 )
96+ !121 = !DILocation (line: 14 , column: 9 , scope: !100 )
97+
98+ !130 = !DILocalVariable (name: "a" , scope: !100 , file: !2 , line: 15 , type: !30 )
99+ !131 = !DILocation (line: 15 , column: 9 , scope: !100 )
100+
101+ !140 = !DILocalVariable (name: "adyn" , scope: !100 , file: !2 , line: 16 , type: !40 )
102+ !141 = !DILocation (line: 16 , column: 9 , scope: !100 )
103+
104+ !150 = !DILocalVariable (name: "i2" , scope: !100 , file: !2 , line: 17 , type: !10 )
105+ !151 = !DILocation (line: 17 , column: 9 , scope: !100 )
106+
107+ !160 = !DILocalVariable (name: "adyn2" , scope: !100 , file: !2 , line: 18 , type: !40 )
108+ !161 = !DILocation (line: 18 , column: 9 , scope: !100 )
109+
110+ !200 = distinct !DISubprogram (name: "g" , scope: !2 , file: !2 , line: 3 , type: !201 , scopeLine: 3 , spFlags: DISPFlagDefinition, unit: !1 , retainedNodes: !4 )
111+ !201 = !DISubroutineType (types: !3 )
112+
113+ !210 = !DILocalVariable (name: "i" , scope: !200 , file: !2 , line: 4 , type: !10 )
114+ !211 = !DILocation (line: 4 , column: 7 , scope: !200 )
115+
116+ !220 = !DILocalVariable (name: "a" , scope: !200 , file: !2 , line: 5 , type: !30 )
117+ !221 = !DILocation (line: 5 , column: 7 , scope: !200 )
0 commit comments