16
16
; RUN: llvm-profdata merge %S/Inputs/memprof.memprofraw --profiled-binary %S/Inputs/memprof.exe -o %t.memprofdata
17
17
; RUN: llvm-profdata merge %S/Inputs/memprof_pgo.proftext %S/Inputs/memprof.memprofraw --profiled-binary %S/Inputs/memprof.exe -o %t.pgomemprofdata
18
18
; RUN: llvm-profdata merge %S/Inputs/memprof_pgo.proftext -o %t.pgoprofdata
19
+ ; RUN: llvm-profdata merge %S/Inputs/memprof.nocolinfo.memprofraw --profiled-binary %S/Inputs/memprof.nocolinfo.exe -o %t.nocolinfo.memprofdata
19
20
20
21
;; In all below cases we should not get any messages about missing profile data
21
22
;; for any functions. Either we are not performing any matching for a particular
28
29
; There should not be any PGO metadata
29
30
; MEMPROFONLY-NOT: !prof
30
31
32
+ ;; Try again but using a profile with missing columns. The memprof matcher
33
+ ;; should recognize that there are no non-zero columns in the profile and
34
+ ;; not attempt to include column numbers in the matching (which means that the
35
+ ;; stack ids will be different).
36
+ ; RUN: opt < %s -passes='memprof-use<profile-filename=%t.nocolinfo.memprofdata>' -pgo-warn-missing-function -S 2>&1 | FileCheck %s --check-prefixes=MEMPROFNOCOLINFO,ALL,MEMPROFONLY
37
+
31
38
;; Test the same thing but by passing the memory profile through to a default
32
39
;; pipeline via -memory-profile-file=, which should cause the necessary field
33
40
;; of the PGOOptions structure to be populated with the profile filename.
@@ -66,6 +73,7 @@ target triple = "x86_64-unknown-linux-gnu"
66
73
define dso_local noundef ptr @_Z3foov () #0 !dbg !10 {
67
74
entry:
68
75
; MEMPROF: call {{.*}} @_Znam{{.*}} !memprof ![[M1:[0-9]+]], !callsite ![[C1:[0-9]+]]
76
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Znam{{.*}} !memprof ![[M1:[0-9]+]], !callsite ![[C1:[0-9]+]]
69
77
%call = call noalias noundef nonnull ptr @_Znam (i64 noundef 10 ) #6 , !dbg !13
70
78
ret ptr %call , !dbg !14
71
79
}
@@ -78,6 +86,7 @@ declare noundef nonnull ptr @_Znam(i64 noundef) #1
78
86
define dso_local noundef ptr @_Z4foo2v () #0 !dbg !15 {
79
87
entry:
80
88
; MEMPROF: call {{.*}} @_Z3foov{{.*}} !callsite ![[C2:[0-9]+]]
89
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z3foov{{.*}} !callsite ![[C2:[0-9]+]]
81
90
%call = call noundef ptr @_Z3foov (), !dbg !16
82
91
ret ptr %call , !dbg !17
83
92
}
86
95
define dso_local noundef ptr @_Z3barv () #0 !dbg !18 {
87
96
entry:
88
97
; MEMPROF: call {{.*}} @_Z4foo2v{{.*}} !callsite ![[C3:[0-9]+]]
98
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z4foo2v{{.*}} !callsite ![[C3:[0-9]+]]
89
99
%call = call noundef ptr @_Z4foo2v (), !dbg !19
90
100
ret ptr %call , !dbg !20
91
101
}
@@ -94,6 +104,7 @@ entry:
94
104
define dso_local noundef ptr @_Z3bazv () #0 !dbg !21 {
95
105
entry:
96
106
; MEMPROF: call {{.*}} @_Z4foo2v{{.*}} !callsite ![[C4:[0-9]+]]
107
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z4foo2v{{.*}} !callsite ![[C4:[0-9]+]]
97
108
%call = call noundef ptr @_Z4foo2v (), !dbg !22
98
109
ret ptr %call , !dbg !23
99
110
}
@@ -110,6 +121,7 @@ entry:
110
121
111
122
if.then: ; preds = %entry
112
123
; MEMPROF: call {{.*}} @_Z3foov{{.*}} !callsite ![[C5:[0-9]+]]
124
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z3foov{{.*}} !callsite ![[C5:[0-9]+]]
113
125
%call = call noundef ptr @_Z3foov (), !dbg !27
114
126
store ptr %call , ptr %retval , align 8 , !dbg !28
115
127
br label %return , !dbg !28
@@ -118,6 +130,7 @@ if.end: ; preds = %entry
118
130
%1 = load i32 , ptr %n.addr , align 4 , !dbg !29
119
131
%sub = sub i32 %1 , 1 , !dbg !30
120
132
; MEMPROF: call {{.*}} @_Z7recursej{{.*}} !callsite ![[C6:[0-9]+]]
133
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z7recursej{{.*}} !callsite ![[C6:[0-9]+]]
121
134
%call1 = call noundef ptr @_Z7recursej (i32 noundef %sub ), !dbg !31
122
135
store ptr %call1 , ptr %retval , align 8 , !dbg !32
123
136
br label %return , !dbg !32
@@ -145,21 +158,27 @@ entry:
145
158
store i32 %argc , ptr %argc.addr , align 4
146
159
store ptr %argv , ptr %argv.addr , align 8
147
160
; MEMPROF: call {{.*}} @_Znam{{.*}} #[[A1:[0-9]+]]
161
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Znam{{.*}} #[[A1:[0-9]+]]
148
162
%call = call noalias noundef nonnull ptr @_Znam (i64 noundef 10 ) #6 , !dbg !35
149
163
store ptr %call , ptr %a , align 8 , !dbg !36
150
164
; MEMPROF: call {{.*}} @_Znam{{.*}} #[[A2:[0-9]+]]
165
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Znam{{.*}} #[[A2:[0-9]+]]
151
166
%call1 = call noalias noundef nonnull ptr @_Znam (i64 noundef 10 ) #6 , !dbg !37
152
167
store ptr %call1 , ptr %b , align 8 , !dbg !38
153
168
; MEMPROF: call {{.*}} @_Z3foov{{.*}} !callsite ![[C7:[0-9]+]]
169
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z3foov{{.*}} !callsite ![[C7:[0-9]+]]
154
170
%call2 = call noundef ptr @_Z3foov (), !dbg !39
155
171
store ptr %call2 , ptr %c , align 8 , !dbg !40
156
172
; MEMPROF: call {{.*}} @_Z3foov{{.*}} !callsite ![[C8:[0-9]+]]
173
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z3foov{{.*}} !callsite ![[C8:[0-9]+]]
157
174
%call3 = call noundef ptr @_Z3foov (), !dbg !41
158
175
store ptr %call3 , ptr %d , align 8 , !dbg !42
159
176
; MEMPROF: call {{.*}} @_Z3barv{{.*}} !callsite ![[C9:[0-9]+]]
177
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z3barv{{.*}} !callsite ![[C9:[0-9]+]]
160
178
%call4 = call noundef ptr @_Z3barv (), !dbg !43
161
179
store ptr %call4 , ptr %e , align 8 , !dbg !44
162
180
; MEMPROF: call {{.*}} @_Z3bazv{{.*}} !callsite ![[C10:[0-9]+]]
181
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z3bazv{{.*}} !callsite ![[C10:[0-9]+]]
163
182
%call5 = call noundef ptr @_Z3bazv (), !dbg !45
164
183
store ptr %call5 , ptr %f , align 8 , !dbg !46
165
184
%0 = load ptr , ptr %a , align 8 , !dbg !47
@@ -241,6 +260,7 @@ for.body: ; preds = %for.cond
241
260
%13 = load i32 , ptr %i , align 4 , !dbg !84
242
261
%add = add i32 %13 , 3 , !dbg !85
243
262
; MEMPROF: call {{.*}} @_Z7recursej{{.*}} !callsite ![[C11:[0-9]+]]
263
+ ; MEMPROFNOCOLINFO: call {{.*}} @_Z7recursej{{.*}} !callsite ![[C11:[0-9]+]]
244
264
%call22 = call noundef ptr @_Z7recursej (i32 noundef %add ), !dbg !86
245
265
store ptr %call22 , ptr %g , align 8 , !dbg !87
246
266
%14 = load ptr , ptr %g , align 8 , !dbg !88
@@ -300,6 +320,32 @@ for.end: ; preds = %for.cond
300
320
; MEMPROF: ![[C10]] = !{i64 2061451396820446691}
301
321
; MEMPROF: ![[C11]] = !{i64 1544787832369987002}
302
322
323
+
324
+ ; MEMPROFNOCOLINFO: #[[A1]] = { builtin allocsize(0) "memprof"="notcold" }
325
+ ; MEMPROFNOCOLINFO: #[[A2]] = { builtin allocsize(0) "memprof"="cold" }
326
+ ; MEMPROFNOCOLINFO: ![[M1]] = !{![[MIB1:[0-9]+]], ![[MIB2:[0-9]+]], ![[MIB3:[0-9]+]], ![[MIB4:[0-9]+]], ![[MIB5:[0-9]+]]}
327
+ ; MEMPROFNOCOLINFO: ![[MIB1]] = !{![[STACK1:[0-9]+]], !"cold"}
328
+ ; MEMPROFNOCOLINFO: ![[STACK1]] = !{i64 5281664982037379640, i64 6362220161075421157, i64 -5772587307814069790, i64 -5772587307814069790, i64 -5772587307814069790, i64 3577763375057267810}
329
+ ; MEMPROFNOCOLINFO: ![[MIB2]] = !{![[STACK2:[0-9]+]], !"notcold"}
330
+ ; MEMPROFNOCOLINFO: ![[STACK2]] = !{i64 5281664982037379640, i64 6362220161075421157, i64 -5772587307814069790, i64 -5772587307814069790, i64 -5772587307814069790, i64 -5772587307814069790}
331
+ ; MEMPROFNOCOLINFO: ![[MIB3]] = !{![[STACK3:[0-9]+]], !"notcold"}
332
+ ; MEMPROFNOCOLINFO: ![[STACK3]] = !{i64 5281664982037379640, i64 -6896091699916449732}
333
+ ; MEMPROFNOCOLINFO: ![[MIB4]] = !{![[STACK4:[0-9]+]], !"cold"}
334
+ ; MEMPROFNOCOLINFO: ![[STACK4]] = !{i64 5281664982037379640, i64 -6871734214936418908}
335
+ ; MEMPROFNOCOLINFO: ![[MIB5]] = !{![[STACK5:[0-9]+]], !"cold"}
336
+ ; MEMPROFNOCOLINFO: ![[STACK5]] = !{i64 5281664982037379640, i64 -6201180255894224618}
337
+ ; MEMPROFNOCOLINFO: ![[C1]] = !{i64 5281664982037379640}
338
+ ; MEMPROFNOCOLINFO: ![[C2]] = !{i64 -6871734214936418908}
339
+ ; MEMPROFNOCOLINFO: ![[C3]] = !{i64 -5588766871448036195}
340
+ ; MEMPROFNOCOLINFO: ![[C4]] = !{i64 -8990226808646054327}
341
+ ; MEMPROFNOCOLINFO: ![[C5]] = !{i64 6362220161075421157}
342
+ ; MEMPROFNOCOLINFO: ![[C6]] = !{i64 -5772587307814069790}
343
+ ; MEMPROFNOCOLINFO: ![[C7]] = !{i64 -6896091699916449732}
344
+ ; MEMPROFNOCOLINFO: ![[C8]] = !{i64 -6201180255894224618}
345
+ ; MEMPROFNOCOLINFO: ![[C9]] = !{i64 -962804290746547393}
346
+ ; MEMPROFNOCOLINFO: ![[C10]] = !{i64 -4535090212904553409}
347
+ ; MEMPROFNOCOLINFO: ![[C11]] = !{i64 3577763375057267810}
348
+
303
349
; Function Attrs: argmemonly nofree nounwind willreturn writeonly
304
350
declare void @llvm.memset.p0.i64 (ptr nocapture writeonly , i8 , i64 , i1 immarg) #3
305
351
0 commit comments