1; REQUIRES: x86_64-linux 2; REQUIRES: asserts 3; RUN: llc -enable-fs-discriminator -improved-fs-discriminator=false --debug-only=mirfs-discriminators < %s -o - 2>&1 | FileCheck %s --check-prefixes=V0 4; RUN: llc -enable-fs-discriminator -improved-fs-discriminator=true --debug-only=mirfs-discriminators < %s -o - 2>&1 | FileCheck %s --check-prefixes=V1 5 6; Check that fs-afdo discriminators are generated. 7; V0: foo.c:7:3: add FS discriminator, from 0 -> 11264 8; V0: foo.c:9:5: add FS discriminator, from 0 -> 11264 9; V0: Num of FS Discriminators: 2 10 11; V1: foo.c:7:3: add FS discriminator, from 0 -> 256 12; V1: foo.c:9:5: add FS discriminator, from 0 -> 256 13; V1: Num of FS Discriminators: 2 14 15target triple = "x86_64-unknown-linux-gnu" 16 17%struct.Node = type { ptr } 18 19define i32 @foo(ptr readonly %node, ptr readnone %root) !dbg !6 { 20entry: 21 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 1, i32 0, i64 -1), !dbg !8 22 %cmp = icmp eq ptr %node, %root, !dbg !8 23 br i1 %cmp, label %while.end4, label %while.cond1.preheader.lr.ph, !dbg !10 24 25while.cond1.preheader.lr.ph: 26 %tobool = icmp eq ptr %node, null 27 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 2, i32 0, i64 -1), !dbg !11 28 br i1 %tobool, label %while.cond1.preheader.us.preheader, label %while.body2.preheader, !dbg !11 29 30while.body2.preheader: 31 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 2, i32 0, i64 -1), !dbg !11 32 br label %while.body2, !dbg !11 33 34while.cond1.preheader.us.preheader: 35 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 3, i32 0, i64 -1), !dbg !10 36 br label %while.cond1.preheader.us, !dbg !10 37 38while.cond1.preheader.us: 39 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 3, i32 0, i64 -1), !dbg !10 40 br label %while.cond1.preheader.us, !dbg !10 41 42while.body2: 43 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 2, i32 0, i64 -1), !dbg !11 44 br label %while.body2, !dbg !11 45 46while.end4: 47 call void @llvm.pseudoprobe(i64 6699318081062747564, i64 4, i32 0, i64 -1), !dbg !12 48 ret i32 0, !dbg !12 49} 50 51declare void @llvm.pseudoprobe(i64, i64, i32, i64) #0 52 53attributes #0 = { inaccessiblememonly nocallback nofree nosync nounwind willreturn } 54 55!llvm.dbg.cu = !{!0} 56!llvm.module.flags = !{!3, !4} 57!llvm.pseudo_probe_desc = !{!13} 58 59!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, debugInfoForProfiling: true, emissionKind: LineTablesOnly) 60!1 = !DIFile(filename: "foo.c", directory: "b/") 61!2 = !{} 62!3 = !{i32 2, !"Dwarf Version", i32 4} 63!4 = !{i32 2, !"Debug Info Version", i32 3} 64!5 = !{} 65!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) 66!7 = !DISubroutineType(types: !2) 67!8 = !DILocation(line: 7, column: 15, scope: !9) 68;; The discriminator with value 2 is to test that it can be cleaned up by the first FS discriminator pass. 69!9 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2) 70!10 = !DILocation(line: 7, column: 3, scope: !9) 71!11 = !DILocation(line: 9, column: 5, scope: !9) 72!12 = !DILocation(line: 14, column: 3, scope: !6) 73!13 = !{i64 6699318081062747564, i64 138464321060, !"foo"} 74