xref: /llvm-project/llvm/test/CodeGen/X86/fsafdo_test4.ll (revision 51a29b5f16efab7f46106b6ce14cbfa50d991040)
1; RUN: llc -enable-fs-discriminator -improved-fs-discriminator=false < %s | FileCheck --implicit-check-not=.loc %s
2; RUN: llc -enable-fs-discriminator -improved-fs-discriminator=true < %s | FileCheck --implicit-check-not=.loc %s
3;
4; Check that fs-afdo discriminators are NOT generated, as debugInfoForProfiling is false (not set).
5; CHECK: .loc    1 7 15 prologue_end discriminator 2 # foo.c:7:15
6; CHECK: .loc    1 7 3 is_stmt 0 discriminator 2 # foo.c:7:3
7; CHECK: .loc    1 0 3 # foo.c:0:3
8; CHECK: .loc    1 9 5 is_stmt 1 discriminator 2 # foo.c:9:5
9; CHECK: .loc    1 0 5 is_stmt 0 # :0:5
10; CHECK: .loc    1 9 5 discriminator 2 # foo.c:9:5
11; CHECK: .loc    1 0 5 # :0:5
12; CHECK: .loc	   1 7 3 is_stmt 1 discriminator 2 # foo.c:7:3
13; CHECK: .loc    1 14 3 # foo.c:14:3
14; Check that variable __llvm_fs_discriminator__ is NOT generated.
15; CHECK-NOT: __llvm_fs_discriminator__:
16
17target triple = "x86_64-unknown-linux-gnu"
18
19%struct.Node = type { ptr }
20
21define i32 @foo(ptr readonly %node, ptr readnone %root) !dbg !6 {
22entry:
23  %cmp = icmp eq ptr %node, %root, !dbg !8
24  br i1 %cmp, label %while.end4, label %while.cond1.preheader.lr.ph, !dbg !10
25
26while.cond1.preheader.lr.ph:
27  %tobool = icmp eq ptr %node, null
28  br i1 %tobool, label %while.cond1.preheader.us.preheader, label %while.body2.preheader, !dbg !11
29
30while.body2.preheader:
31  br label %while.body2, !dbg !11
32
33while.cond1.preheader.us.preheader:
34  br label %while.cond1.preheader.us, !dbg !10
35
36while.cond1.preheader.us:
37  br label %while.cond1.preheader.us, !dbg !10
38
39while.body2:
40  br label %while.body2, !dbg !11
41
42while.end4:
43  ret i32 0, !dbg !12
44}
45
46!llvm.dbg.cu = !{!0}
47!llvm.module.flags = !{!3, !4}
48
49!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, emissionKind: LineTablesOnly)
50!1 = !DIFile(filename: "foo.c", directory: "b/")
51!2 = !{}
52!3 = !{i32 2, !"Dwarf Version", i32 4}
53!4 = !{i32 2, !"Debug Info Version", i32 3}
54!5 = !{}
55!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, type: !7, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
56!7 = !DISubroutineType(types: !2)
57!8 = !DILocation(line: 7, column: 15, scope: !9)
58!9 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2)
59!10 = !DILocation(line: 7, column: 3, scope: !9)
60!11 = !DILocation(line: 9, column: 5, scope: !9)
61!12 = !DILocation(line: 14, column: 3, scope: !6)
62