@@ -71,7 +71,7 @@ declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1
7171; Function Attrs: nobuiltin
7272declare void @_ZdaPv () #2
7373
74- define internal ptr @_Z3barv () #3 {
74+ define internal ptr @_Z3barv () #3 !dbg !15 {
7575entry:
7676 %call = call noalias noundef nonnull ptr @_Znam (i64 noundef 10 ) #6 , !memprof !2 , !callsite !7
7777 ret ptr null
@@ -103,6 +103,9 @@ attributes #4 = { "stack-protector-buffer-size"="8" }
103103attributes #5 = { noinline }
104104attributes #6 = { builtin }
105105
106+ !llvm.dbg.cu = !{!13 }
107+ !llvm.module.flags = !{!20 , !21 }
108+
106109!0 = !{i64 8632435727821051414 }
107110!1 = !{i64 -3421689549917153178 }
108111!2 = !{!3 , !5 }
@@ -116,7 +119,15 @@ attributes #6 = { builtin }
116119!10 = !{i64 123 , i64 100 }
117120!11 = !{i64 456 , i64 200 }
118121!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 ([email protected] :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 }
120131
121132; DUMP: CCG before cloning:
122133; DUMP: Callsite Context Graph:
@@ -270,14 +281,16 @@ attributes #6 = { builtin }
270281; IR: call {{.*}} @_Z3barv()
271282; IR: define internal {{.*}} @_Z3foov()
272283; IR: call {{.*}} @_Z3bazv()
273- ; IR: define internal {{.*}} @_Z3barv.memprof.1()
284+ ; IR: define internal {{.*}} @_Z3barv.memprof.1() {{.*}} !dbg ![[SP:[0-9]+]]
274285; IR: call {{.*}} @_Znam(i64 noundef 10) #[[COLD:[0-9]+]]
275286; IR: define internal {{.*}} @_Z3bazv.memprof.1()
276287; IR: call {{.*}} @_Z3barv.memprof.1()
277288; IR: define internal {{.*}} @_Z3foov.memprof.1()
278289; IR: call {{.*}} @_Z3bazv.memprof.1()
279290; IR: attributes #[[NOTCOLD]] = { builtin "memprof"="notcold" }
280291; 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"
281294
282295
283296; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
0 commit comments