Debian Codegraph @

llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll

raw
1 ; RUN: opt < %s -passes='default<O2>' -debug-info-for-profiling -S | FileCheck %s --check-prefix=DEBUG
2 ; RUN: opt < %s -passes='default<O2>' -debug-info-for-profiling -pseudo-probe-for-profiling -S | FileCheck %s --check-prefix=PROBE
3 ; RUN: opt < %s -passes='thinlto-pre-link<O2>' -debug-info-for-profiling -pseudo-probe-for-profiling -S | FileCheck %s --check-prefix=PROBE
4
5 @a = dso_local global i32 0, align 4
6
7 ; Function Attrs: uwtable
8 define void @_Z3foov(i32 %x) !dbg !4 {
9 bb0:
10 %cmp = icmp eq i32 %x, 0, !dbg !10
11 br i1 %cmp, label %bb1, label %bb2
12
13 bb1:
14 ; DEBUG: call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]]
15 ; PROBE: call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]]
16 call void @_Z3barv(), !dbg !10
17 ; DEBUG: call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]]
18 ; PROBE: call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]]
19 call void @_Z3barv(), !dbg !11
20 ret void, !dbg !13
21
22 bb2:
23 ; DEBUG: store i32 8, ptr @a, align 4, !dbg ![[INST:[0-9]+]]
24 ; PROBE: store i32 8, ptr @a, align 4, !dbg ![[INST:[0-9]+]]
25 store i32 8, ptr @a, align 4, !dbg !12
26 br label %bb3
27
28 bb3:
29 ret void, !dbg !12
30 }
31
32 declare void @_Z3barv()
33 declare void @llvm.lifetime.start.p0(ptr nocapture) nounwind argmemonly
34 declare void @llvm.lifetime.end.p0(ptr nocapture) nounwind argmemonly
35
36 !llvm.dbg.cu = !{!0}
37 !llvm.module.flags = !{!7, !8}
38 !llvm.ident = !{!9}
39
40 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
41 !1 = !DIFile(filename: "c.cc", directory: "/tmp")
42 !2 = !{}
43 !4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
44 !5 = !DISubroutineType(types: !6)
45 !6 = !{null}
46 !7 = !{i32 2, !"Dwarf Version", i32 4}
47 !8 = !{i32 2, !"Debug Info Version", i32 3}
48 !9 = !{!"clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)"}
49 !10 = !DILocation(line: 4, column: 3, scope: !4)
50 !11 = !DILocation(line: 4, column: 9, scope: !4)
51 !12 = !DILocation(line: 4, column: 15, scope: !4)
52 !13 = !DILocation(line: 5, column: 1, scope: !4)
53
54 ; DEBUG: ![[CALL1]] = !DILocation(line: 4, column: 3, scope: ![[CALL1BLOCK:[0-9]+]])
55 ; DEBUG: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2)
56 ; DEBUG: ![[CALL2]] = !DILocation(line: 4, column: 9, scope: ![[CALL2BLOCK:[0-9]+]])
57 ; DEBUG: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 8)
58 ; DEBUG: ![[INST]] = !DILocation(line: 4, column: 15, scope: ![[INSTBLOCK:[0-9]+]])
59 ; DEBUG: ![[INSTBLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)
60
61 ; PROBE: ![[CALL1]] = !DILocation(line: 4, column: 3, scope: ![[CALL1BLOCK:[0-9]+]])
62 ; PROBE: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 455147551)
63 ; PROBE: ![[CALL2]] = !DILocation(line: 4, column: 9, scope: ![[CALL2BLOCK:[0-9]+]])
64 ; PROBE: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 455344167)
65 ; PROBE: ![[INST]] = !DILocation(line: 4, column: 15, scope: ![[INSTBLOCK:[0-9]+]])
66 ; PROBE: ![[INSTBLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)