@@ -62,32 +62,47 @@ HeapProfileRecords:
6262 CallSites:
6363 - Frames:
6464 - { Function: _Z3foov, LineOffset: 3, Column: 5, IsInlineFrame: false }
65- CalleeGuids: [0x123456789abcdef0, 0x23456789abcdef01]
65+ CalleeGuids: [0x123456789abcdef0, 0x23456789abcdef01, 0x7f8d88fcc70a347b ]
6666 - Frames:
6767 - { Function: _Z3foov, LineOffset: 5, Column: 5, IsInlineFrame: false }
6868 CalleeGuids: [0x555556789abcdef0, 0x666656789abcdef1]
69+ - Frames:
70+ - { Function: _Z3foov, LineOffset: 6, Column: 5, IsInlineFrame: false }
71+ CalleeGuids: [0xf129122801e64264, 0x7f8d88fcc70a347b]
6972...
7073
7174;--- fdo_conflict.ll
7275define dso_local void @_Z3foov() !dbg !14 {
7376entry:
7477 %fp = alloca ptr, align 8
7578 %0 = load ptr, ptr %fp, align 8
76- ; This call already has FDO value profile metadata - should NOT be modified
77- ; CHECK-FDO: call void %0(), {{.*}} !prof !6
79+ ; This call already has FDO value profile metadata - new GUIDs should be appended.
80+ ; The profile contains 0x7f8d88fcc70a347b (9191153033785521275) which already
81+ ; exists in VP metadata and should not be re-added or affect count.
82+ ; CHECK-FDO: call void %0(), {{.*}} !prof ![[VP1:[0-9]+]]
7883 call void %0(), !dbg !15, !prof !16
7984
8085 %1 = load ptr, ptr %fp, align 8
8186 ; This call does NOT have existing metadata - should get MemProf annotation
82- ; CHECK-FDO: call void %1(), {{.*}} !prof !9
87+ ; CHECK-FDO: call void %1(), {{.*}} !prof ![[VP2:[0-9]+]]
8388 call void %1(), !dbg !17
89+
90+ %2 = load ptr, ptr %fp, align 8
91+ ; This call already has FDO value profile metadata, and the profile contains
92+ ; the same 2 callee guids that are already included in the VP metadata:
93+ ; 0x7f8d88fcc70a347b (9191153033785521275) and 0xf129122801e64264 which is
94+ ; 17377440600225628772 aka -1069303473483922844. The metadata should not be affected.
95+ ; CHECK-FDO: call void %2(), {{.*}} !prof ![[VP3:[0-9]+]]
96+ call void %2(), !dbg !18, !prof !19
8497 ret void
8598}
8699
87100!16 = !{!"VP", i32 0, i64 100, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20}
101+ !19 = !{!"VP", i32 0, i64 100, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20}
88102
89- ; CHECK-FDO: !6 = !{!"VP", i32 0, i64 100, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20}
90- ; CHECK-FDO: !9 = !{!"VP", i32 0, i64 2, i64 6148915942236413680, i64 1, i64 7378680115485269745, i64 1}
103+ ; CHECK-FDO: ![[VP1]] = !{!"VP", i32 0, i64 102, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20, i64 1311768467463790320, i64 1, i64 2541551405711093505, i64 1}
104+ ; CHECK-FDO: ![[VP2]] = !{!"VP", i32 0, i64 2, i64 6148915942236413680, i64 1, i64 7378680115485269745, i64 1}
105+ ; CHECK-FDO: ![[VP3]] = !{!"VP", i32 0, i64 100, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20}
91106
92107!llvm.module.flags = !{!12, !13}
93108
@@ -98,3 +113,4 @@ entry:
98113!14 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !11, file: !11, line: 1, unit: !10)
99114!15 = !DILocation(line: 4, column: 5, scope: !14)
100115!17 = !DILocation(line: 6, column: 5, scope: !14)
116+ !18 = !DILocation(line: 7, column: 5, scope: !14)
0 commit comments