@@ -71,7 +71,7 @@ declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1
71
71
; Function Attrs: nobuiltin
72
72
declare void @_ZdaPv () #2
73
73
74
- define internal ptr @_Z3barv () #3 {
74
+ define internal ptr @_Z3barv () #3 !dbg !15 {
75
75
entry:
76
76
%call = call noalias noundef nonnull ptr @_Znam (i64 noundef 10 ) #6 , !memprof !2 , !callsite !7
77
77
ret ptr null
@@ -103,6 +103,9 @@ attributes #4 = { "stack-protector-buffer-size"="8" }
103
103
attributes #5 = { noinline }
104
104
attributes #6 = { builtin }
105
105
106
+ !llvm.dbg.cu = !{!13 }
107
+ !llvm.module.flags = !{!20 , !21 }
108
+
106
109
!0 = !{i64 8632435727821051414 }
107
110
!1 = !{i64 -3421689549917153178 }
108
111
!2 = !{!3 , !5 }
@@ -116,7 +119,15 @@ attributes #6 = { builtin }
116
119
!10 = !{i64 123 , i64 100 }
117
120
!11 = !{i64 456 , i64 200 }
118
121
!12 = !{i64 789 , i64 300 }
119
-
122
+ !13 = distinct !DICompileUnit (language: DW_LANG_C_plus_plus_14, file: !14 , producer: "clang version 21.0.0git (git@github.com:llvm/llvm-project.git e391301e0e4d9183fe06e69602e87b0bc889aeda)" , isOptimized: true , runtimeVersion: 0 , emissionKind: FullDebug, splitDebugInlining: false , nameTableKind: None)
123
+ !14 = !DIFile (filename: "basic.cc" , directory: "" , checksumkind: CSK_MD5, checksum: "8636c46e81402013b9d54e8307d2f149" )
124
+ !15 = distinct !DISubprogram (name: "bar" , linkageName: "_Z3barv" , scope: !14 , file: !14 , line: 1 , type: !16 , scopeLine: 1 , flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !13 )
125
+ !16 = !DISubroutineType (types: !17 )
126
+ !17 = !{!18 }
127
+ !18 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !19 , size: 64 )
128
+ !19 = !DIBasicType (name: "char" , size: 8 , encoding: DW_ATE_signed_char)
129
+ !20 = !{i32 7 , !"Dwarf Version" , i32 5 }
130
+ !21 = !{i32 2 , !"Debug Info Version" , i32 3 }
120
131
121
132
; DUMP: CCG before cloning:
122
133
; DUMP: Callsite Context Graph:
@@ -270,14 +281,16 @@ attributes #6 = { builtin }
270
281
; IR: call {{.*}} @_Z3barv()
271
282
; IR: define internal {{.*}} @_Z3foov()
272
283
; IR: call {{.*}} @_Z3bazv()
273
- ; IR: define internal {{.*}} @_Z3barv.memprof.1()
284
+ ; IR: define internal {{.*}} @_Z3barv.memprof.1() {{.*}} !dbg ![[SP:[0-9]+]]
274
285
; IR: call {{.*}} @_Znam(i64 noundef 10) #[[COLD:[0-9]+]]
275
286
; IR: define internal {{.*}} @_Z3bazv.memprof.1()
276
287
; IR: call {{.*}} @_Z3barv.memprof.1()
277
288
; IR: define internal {{.*}} @_Z3foov.memprof.1()
278
289
; IR: call {{.*}} @_Z3bazv.memprof.1()
279
290
; IR: attributes #[[NOTCOLD]] = { builtin "memprof"="notcold" }
280
291
; IR: attributes #[[COLD]] = { builtin "memprof"="cold" }
292
+ ;; Make sure the clone's linkageName was updated.
293
+ ; IR: ![[SP]] = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv.memprof.1"
281
294
282
295
283
296
; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
0 commit comments