Skip to content

Commit 83aa725

Browse files
[MemProf][NFC] Simplify test case (#73979)
Removes some unnecessary testing of dump and dot file formats, to simplify updates to this test.
1 parent e1395c7 commit 83aa725

File tree

1 file changed

+6
-136
lines changed

1 file changed

+6
-136
lines changed

llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll

Lines changed: 6 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,10 @@
6464
; RUN: -r=%t.o,sleep, \
6565
; RUN: -r=%t.o,_Znam, \
6666
; RUN: -memprof-verify-ccg -memprof-verify-nodes -memprof-dump-ccg \
67-
; RUN: -memprof-export-to-dot -memprof-dot-file-path-prefix=%t. \
6867
; RUN: -stats -pass-remarks=memprof-context-disambiguation -save-temps \
6968
; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=DUMP \
7069
; RUN: --check-prefix=STATS --check-prefix=STATS-BE --check-prefix=REMARKS
7170

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-
7771
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
7872

7973

@@ -86,15 +80,10 @@
8680
; RUN: -r=%t.o,sleep, \
8781
; RUN: -r=%t.o,_Znam, \
8882
; RUN: -memprof-verify-ccg -memprof-verify-nodes -memprof-dump-ccg \
89-
; RUN: -memprof-export-to-dot -memprof-dot-file-path-prefix=%t2. \
9083
; RUN: -stats -pass-remarks=memprof-context-disambiguation \
9184
; RUN: -o %t2.out 2>&1 | FileCheck %s --check-prefix=DUMP \
9285
; RUN: --check-prefix=STATS
9386

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
9887

9988
;; Check distributed index
10089
; RUN: llvm-dis %t.o.thinlto.bc -o - | FileCheck %s --check-prefix=DISTRIB
@@ -184,22 +173,6 @@ attributes #0 = { noinline optnone}
184173
; DUMP: Edge from Callee [[D]] to Caller: [[C:0x[a-z0-9]+]] AllocTypes: Cold ContextIds: 1
185174
; DUMP: Edge from Callee [[D]] to Caller: [[F:0x[a-z0-9]+]] AllocTypes: NotCold ContextIds: 2
186175

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-
203176
;; After updating for callsite metadata, we should have generated context ids 3 and 4,
204177
;; along with 2 new nodes for those callsites. All have the same allocation type
205178
;; behavior as the original C node.
@@ -216,42 +189,9 @@ attributes #0 = { noinline optnone}
216189
; DUMP: CalleeEdges:
217190
; DUMP: CallerEdges:
218191
; 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
255195

256196
; DUMP: CCG after cloning:
257197
; DUMP: Callsite Context Graph:
@@ -267,38 +207,6 @@ attributes #0 = { noinline optnone}
267207
; DUMP: Edge from Callee [[D]] to Caller: [[F]] AllocTypes: NotCold ContextIds: 2
268208
; DUMP: Clones: [[D2:0x[a-z0-9]+]]
269209

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-
302210
; DUMP: Node [[D2]]
303211
; DUMP: Versions: 1 MIB:
304212
; DUMP: AllocType 2 StackIds: 0
@@ -308,9 +216,9 @@ attributes #0 = { noinline optnone}
308216
; DUMP: ContextIds: 1 3 4
309217
; DUMP: CalleeEdges:
310218
; 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
314222
; DUMP: Clone of [[D]]
315223

316224
; REMARKS: created clone _Z1Dv.memprof.1
@@ -352,44 +260,6 @@ attributes #0 = { noinline optnone}
352260
; STATS-BE: 1 memprof-context-disambiguation - Number of original (not cloned) allocations with memprof profiles during ThinLTO backend
353261

354262

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-
393263
; DISTRIB: ^[[C:[0-9]+]] = gv: (guid: 1643923691937891493, {{.*}} callsites: ((callee: ^[[D:[0-9]+]], clones: (1)
394264
; DISTRIB: ^[[D]] = gv: (guid: 4881081444663423788, {{.*}} allocs: ((versions: (notcold, cold)
395265
; DISTRIB: ^[[B:[0-9]+]] = gv: (guid: 14590037969532473829, {{.*}} callsites: ((callee: ^[[D]], clones: (1)

0 commit comments

Comments
 (0)