File: fsafdo_test1.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (60 lines) | stat: -rw-r--r-- 2,292 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
; RUN: llc -enable-fs-discriminator < %s | FileCheck %s
;
; Check that fs-afdo discriminators are generated.
; CHECK: .loc    1 7 3 is_stmt 0 discriminator 2 # foo.c:7:3
; Check: .loc    1 9 5 is_stmt 1 discriminator 2 # foo.c:9:5
; CHECK: .loc    1 9 5 is_stmt 0 discriminator 11266 # foo.c:9:5
; CHECK: .loc    1 7 3 is_stmt 1 discriminator 11266 # foo.c:7:3
; Check that variable __llvm_fs_discriminator__ is generated.
; CHECK: .type   __llvm_fs_discriminator__,@object # @__llvm_fs_discriminator__
; CHECK: .section        .rodata,"a",@progbits
; CHECK: .weak   __llvm_fs_discriminator__
; CHECK: __llvm_fs_discriminator__:
; CHECK: .byte   1
; CHECK: .size   __llvm_fs_discriminator__, 1

target triple = "x86_64-unknown-linux-gnu"

%struct.Node = type { %struct.Node* }

define i32 @foo(%struct.Node* readonly %node, %struct.Node* readnone %root) !dbg !6 {
entry:
  %cmp = icmp eq %struct.Node* %node, %root, !dbg !8
  br i1 %cmp, label %while.end4, label %while.cond1.preheader.lr.ph, !dbg !10

while.cond1.preheader.lr.ph:
  %tobool = icmp eq %struct.Node* %node, null
  br i1 %tobool, label %while.cond1.preheader.us.preheader, label %while.body2.preheader, !dbg !11

while.body2.preheader:
  br label %while.body2, !dbg !11

while.cond1.preheader.us.preheader:
  br label %while.cond1.preheader.us, !dbg !10

while.cond1.preheader.us:
  br label %while.cond1.preheader.us, !dbg !10

while.body2:
  br label %while.body2, !dbg !11

while.end4:
  ret i32 0, !dbg !12
}

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, emissionKind: LineTablesOnly)
!1 = !DIFile(filename: "foo.c", directory: "b/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{}
!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)
!7 = !DISubroutineType(types: !2)
!8 = !DILocation(line: 7, column: 15, scope: !9)
!9 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2)
!10 = !DILocation(line: 7, column: 3, scope: !9)
!11 = !DILocation(line: 9, column: 5, scope: !9)
!12 = !DILocation(line: 14, column: 3, scope: !6)