64
64
; RUN: -r=%t.o,sleep, \
65
65
; RUN: -r=%t.o,_Znam, \
66
66
; RUN: -memprof-verify-ccg -memprof-verify-nodes -memprof-dump-ccg \
67
- ; RUN: -memprof-export-to-dot -memprof-dot-file-path-prefix=%t. \
68
67
; RUN: -stats -pass-remarks=memprof-context-disambiguation -save-temps \
69
68
; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=DUMP \
70
69
; RUN: --check-prefix=STATS --check-prefix=STATS-BE --check-prefix=REMARKS
71
70
72
- ; RUN: cat %t.ccg.prestackupdate.dot | FileCheck %s --check-prefix=DOTPRE
73
- ; RUN: cat %t.ccg.postbuild.dot | FileCheck %s --check-prefix=DOTPOST
74
- ;; We should clone D once for the cold allocations via C.
75
- ; RUN: cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
76
-
77
71
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
78
72
79
73
86
80
; RUN: -r=%t.o,sleep, \
87
81
; RUN: -r=%t.o,_Znam, \
88
82
; RUN: -memprof-verify-ccg -memprof-verify-nodes -memprof-dump-ccg \
89
- ; RUN: -memprof-export-to-dot -memprof-dot-file-path-prefix=%t2. \
90
83
; RUN: -stats -pass-remarks=memprof-context-disambiguation \
91
84
; RUN: -o %t2.out 2>&1 | FileCheck %s --check-prefix=DUMP \
92
85
; RUN: --check-prefix=STATS
93
86
94
- ; RUN: cat %t.ccg.prestackupdate.dot | FileCheck %s --check-prefix=DOTPRE
95
- ; RUN: cat %t.ccg.postbuild.dot | FileCheck %s --check-prefix=DOTPOST
96
- ;; We should clone D once for the cold allocations via C.
97
- ; RUN: cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
98
87
99
88
;; Check distributed index
100
89
; RUN: llvm-dis %t.o.thinlto.bc -o - | FileCheck %s --check-prefix=DISTRIB
@@ -184,22 +173,6 @@ attributes #0 = { noinline optnone}
184
173
; DUMP: Edge from Callee [[D]] to Caller: [[C:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 1
185
174
; DUMP: Edge from Callee [[D]] to Caller: [[F:0x[a-z0-9]+]] AllocTypes: NotCold ContextIds: 2
186
175
187
- ; DUMP: Node [[C]]
188
- ; DUMP: null Call
189
- ; DUMP: AllocTypes: Cold
190
- ; DUMP: ContextIds: 1
191
- ; DUMP: CalleeEdges:
192
- ; DUMP: Edge from Callee [[D]] to Caller: [[C]] AllocTypes: Cold ContextIds: 1
193
- ; DUMP: CallerEdges:
194
-
195
- ; DUMP: Node [[F]]
196
- ; DUMP: null Call
197
- ; DUMP: AllocTypes: NotCold
198
- ; DUMP: ContextIds: 2
199
- ; DUMP: CalleeEdges:
200
- ; DUMP: Edge from Callee [[D]] to Caller: [[F]] AllocTypes: NotCold ContextIds: 2
201
- ; DUMP: CallerEdges:
202
-
203
176
;; After updating for callsite metadata, we should have generated context ids 3 and 4,
204
177
;; along with 2 new nodes for those callsites. All have the same allocation type
205
178
;; behavior as the original C node.
@@ -216,42 +189,9 @@ attributes #0 = { noinline optnone}
216
189
; DUMP: CalleeEdges:
217
190
; DUMP: CallerEdges:
218
191
; DUMP: Edge from Callee [[D]] to Caller: [[F]] AllocTypes: NotCold ContextIds: 2
219
- ; DUMP: Edge from Callee [[D]] to Caller: [[C2:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 3
220
- ; DUMP: Edge from Callee [[D]] to Caller: [[B:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 4
221
- ; DUMP: Edge from Callee [[D]] to Caller: [[E:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 1
222
-
223
- ; DUMP: Node [[F]]
224
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 1 (clone 0)
225
- ; DUMP: AllocTypes: NotCold
226
- ; DUMP: ContextIds: 2
227
- ; DUMP: CalleeEdges:
228
- ; DUMP: Edge from Callee [[D]] to Caller: [[F]] AllocTypes: NotCold ContextIds: 2
229
- ; DUMP: CallerEdges:
230
-
231
- ; DUMP: Node [[C2]]
232
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 0 (clone 0)
233
- ; DUMP: AllocTypes: Cold
234
- ; DUMP: ContextIds: 3
235
- ; DUMP: CalleeEdges:
236
- ; DUMP: Edge from Callee [[D]] to Caller: [[C2]] AllocTypes: Cold ContextIds: 3
237
- ; DUMP: CallerEdges:
238
-
239
- ; DUMP: Node [[B]]
240
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 0, 2 (clone 0)
241
- ; DUMP: AllocTypes: Cold
242
- ; DUMP: ContextIds: 4
243
- ; DUMP: CalleeEdges:
244
- ; DUMP: Edge from Callee [[D]] to Caller: [[B]] AllocTypes: Cold ContextIds: 4
245
- ; DUMP: CallerEdges:
246
-
247
- ; DUMP: Node [[E]]
248
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 0, 3 (clone 0)
249
- ; DUMP: AllocTypes: Cold
250
- ; DUMP: ContextIds: 1
251
- ; DUMP: CalleeEdges:
252
- ; DUMP: Edge from Callee [[D]] to Caller: [[E]] AllocTypes: Cold ContextIds: 1
253
- ; DUMP: CallerEdges:
254
-
192
+ ; DUMP: Edge from Callee [[D]] to Caller: [[C1:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 3
193
+ ; DUMP: Edge from Callee [[D]] to Caller: [[C2:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 4
194
+ ; DUMP: Edge from Callee [[D]] to Caller: [[C0:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 1
255
195
256
196
; DUMP: CCG after cloning:
257
197
; DUMP: Callsite Context Graph:
@@ -267,38 +207,6 @@ attributes #0 = { noinline optnone}
267
207
; DUMP: Edge from Callee [[D]] to Caller: [[F]] AllocTypes: NotCold ContextIds: 2
268
208
; DUMP: Clones: [[D2:0x[a-z0-9]+]]
269
209
270
- ; DUMP: Node [[F]]
271
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 1 (clone 0)
272
- ; DUMP: AllocTypes: NotCold
273
- ; DUMP: ContextIds: 2
274
- ; DUMP: CalleeEdges:
275
- ; DUMP: Edge from Callee [[D]] to Caller: [[F]] AllocTypes: NotCold ContextIds: 2
276
- ; DUMP: CallerEdges:
277
-
278
- ; DUMP: Node [[C2]]
279
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 0 (clone 0)
280
- ; DUMP: AllocTypes: Cold
281
- ; DUMP: ContextIds: 3
282
- ; DUMP: CalleeEdges:
283
- ; DUMP: Edge from Callee [[D2]] to Caller: [[C2]] AllocTypes: Cold ContextIds: 3
284
- ; DUMP: CallerEdges:
285
-
286
- ; DUMP: Node [[B]]
287
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 0, 2 (clone 0)
288
- ; DUMP: AllocTypes: Cold
289
- ; DUMP: ContextIds: 4
290
- ; DUMP: CalleeEdges:
291
- ; DUMP: Edge from Callee [[D2]] to Caller: [[B]] AllocTypes: Cold ContextIds: 4
292
- ; DUMP: CallerEdges:
293
-
294
- ; DUMP: Node [[E]]
295
- ; DUMP: Callee: 4881081444663423788 (_Z1Dv) Clones: 0 StackIds: 0, 3 (clone 0)
296
- ; DUMP: AllocTypes: Cold
297
- ; DUMP: ContextIds: 1
298
- ; DUMP: CalleeEdges:
299
- ; DUMP: Edge from Callee [[D2]] to Caller: [[E]] AllocTypes: Cold ContextIds: 1
300
- ; DUMP: CallerEdges:
301
-
302
210
; DUMP: Node [[D2]]
303
211
; DUMP: Versions: 1 MIB:
304
212
; DUMP: AllocType 2 StackIds: 0
@@ -308,9 +216,9 @@ attributes #0 = { noinline optnone}
308
216
; DUMP: ContextIds: 1 3 4
309
217
; DUMP: CalleeEdges:
310
218
; DUMP: CallerEdges:
311
- ; DUMP: Edge from Callee [[D2]] to Caller: [[E:0x[a-z0-9]+ ]] AllocTypes: Cold ContextIds: 1
312
- ; DUMP: Edge from Callee [[D2]] to Caller: [[C2:0x[a-z0-9]+ ]] AllocTypes: Cold ContextIds: 3
313
- ; DUMP: Edge from Callee [[D2]] to Caller: [[B:0x[a-z0-9]+ ]] AllocTypes: Cold ContextIds: 4
219
+ ; DUMP: Edge from Callee [[D2]] to Caller: [[C0 ]] AllocTypes: Cold ContextIds: 1
220
+ ; DUMP: Edge from Callee [[D2]] to Caller: [[C1 ]] AllocTypes: Cold ContextIds: 3
221
+ ; DUMP: Edge from Callee [[D2]] to Caller: [[C2 ]] AllocTypes: Cold ContextIds: 4
314
222
; DUMP: Clone of [[D]]
315
223
316
224
; REMARKS: created clone _Z1Dv.memprof.1
@@ -352,44 +260,6 @@ attributes #0 = { noinline optnone}
352
260
; STATS-BE: 1 memprof-context-disambiguation - Number of original (not cloned) allocations with memprof profiles during ThinLTO backend
353
261
354
262
355
- ; DOTPRE: digraph "prestackupdate" {
356
- ; DOTPRE: label="prestackupdate";
357
- ; DOTPRE: Node[[D:0x[a-z0-9]+]] [shape=record,tooltip="N[[D]] ContextIds: 1 2",fillcolor="mediumorchid1",style="filled",style="filled",label="{OrigId: Alloc0\n_Z1Dv -\> alloc}"];
358
- ; DOTPRE: Node[[C:0x[a-z0-9]+]] [shape=record,tooltip="N[[C]] ContextIds: 1",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 12176601099670543485\nnull call (external)}"];
359
- ; DOTPRE: Node[[C]] -> Node[[D]][tooltip="ContextIds: 1",fillcolor="cyan"];
360
- ; DOTPRE: Node[[F:0x[a-z0-9]+]] [shape=record,tooltip="N[[F]] ContextIds: 2",fillcolor="brown1",style="filled",style="filled",label="{OrigId: 13543580133643026784\nnull call (external)}"];
361
- ; DOTPRE: Node[[F]] -> Node[[D]][tooltip="ContextIds: 2",fillcolor="brown1"];
362
- ; DOTPRE: }
363
-
364
-
365
- ; DOTPOST:digraph "postbuild" {
366
- ; DOTPOST: label="postbuild";
367
- ; DOTPOST: Node[[D:0x[a-z0-9]+]] [shape=record,tooltip="N[[D]] ContextIds: 1 2 3 4",fillcolor="mediumorchid1",style="filled",style="filled",label="{OrigId: Alloc0\n_Z1Dv -\> alloc}"];
368
- ; DOTPOST: Node[[F:0x[a-z0-9]+]] [shape=record,tooltip="N[[F]] ContextIds: 2",fillcolor="brown1",style="filled",style="filled",label="{OrigId: 13543580133643026784\n_Z1Fv -\> _Z1Dv}"];
369
- ; DOTPOST: Node[[F]] -> Node[[D]][tooltip="ContextIds: 2",fillcolor="brown1"];
370
- ; DOTPOST: Node[[C:0x[a-z0-9]+]] [shape=record,tooltip="N[[C]] ContextIds: 3",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 0\n_Z1Cv -\> _Z1Dv}"];
371
- ; DOTPOST: Node[[C]] -> Node[[D]][tooltip="ContextIds: 3",fillcolor="cyan"];
372
- ; DOTPOST: Node[[B:0x[a-z0-9]+]] [shape=record,tooltip="N[[B]] ContextIds: 4",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 0\n_Z1Bv -\> _Z1Dv}"];
373
- ; DOTPOST: Node[[B]] -> Node[[D]][tooltip="ContextIds: 4",fillcolor="cyan"];
374
- ; DOTPOST: Node[[E:0x[a-z0-9]+]] [shape=record,tooltip="N[[E]] ContextIds: 1",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 0\n_Z1Ev -\> _Z1Dv}"];
375
- ; DOTPOST: Node[[E]] -> Node[[D]][tooltip="ContextIds: 1",fillcolor="cyan"];
376
- ; DOTPOST:}
377
-
378
-
379
- ; DOTCLONED: digraph "cloned" {
380
- ; DOTCLONED: label="cloned";
381
- ; DOTCLONED: Node[[D:0x[a-z0-9]+]] [shape=record,tooltip="N[[D]] ContextIds: 2",fillcolor="brown1",style="filled",style="filled",label="{OrigId: Alloc0\n_Z1Dv -\> alloc}"];
382
- ; DOTCLONED: Node[[F:0x[a-z0-9]+]] [shape=record,tooltip="N[[F]] ContextIds: 2",fillcolor="brown1",style="filled",style="filled",label="{OrigId: 13543580133643026784\n_Z1Fv -\> _Z1Dv}"];
383
- ; DOTCLONED: Node[[F]] -> Node[[D]][tooltip="ContextIds: 2",fillcolor="brown1"];
384
- ; DOTCLONED: Node[[C:0x[a-z0-9]+]] [shape=record,tooltip="N[[C]] ContextIds: 3",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 0\n_Z1Cv -\> _Z1Dv}"];
385
- ; DOTCLONED: Node[[C]] -> Node[[D2:0x[a-z0-9]+]][tooltip="ContextIds: 3",fillcolor="cyan"];
386
- ; DOTCLONED: Node[[B:0x[a-z0-9]+]] [shape=record,tooltip="N[[B]] ContextIds: 4",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 0\n_Z1Bv -\> _Z1Dv}"];
387
- ; DOTCLONED: Node[[B]] -> Node[[D2]][tooltip="ContextIds: 4",fillcolor="cyan"];
388
- ; DOTCLONED: Node[[E:0x[a-z0-9]+]] [shape=record,tooltip="N[[E]] ContextIds: 1",fillcolor="cyan",style="filled",style="filled",label="{OrigId: 0\n_Z1Ev -\> _Z1Dv}"];
389
- ; DOTCLONED: Node[[E]] -> Node[[D2]][tooltip="ContextIds: 1",fillcolor="cyan"];
390
- ; DOTCLONED: Node[[D2]] [shape=record,tooltip="N[[D2]] ContextIds: 1 3 4",fillcolor="cyan",style="filled",color="blue",style="filled,bold,dashed",label="{OrigId: Alloc0\n_Z1Dv -\> alloc}"];
391
- ; DOTCLONED: }
392
-
393
263
; DISTRIB: ^[[C:[0-9]+]] = gv: (guid: 1643923691937891493, {{.*}} callsites: ((callee: ^[[D:[0-9]+]], clones: (1)
394
264
; DISTRIB: ^[[D]] = gv: (guid: 4881081444663423788, {{.*}} allocs: ((versions: (notcold, cold)
395
265
; DISTRIB: ^[[B:[0-9]+]] = gv: (guid: 14590037969532473829, {{.*}} callsites: ((callee: ^[[D]], clones: (1)
0 commit comments