File: early-inline.ll

package info (click to toggle)
llvm-toolchain-5.0 1:5.0.1-2~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 553,688 kB
  • sloc: cpp: 2,878,786; ansic: 584,110; asm: 246,252; python: 124,751; objc: 106,925; sh: 21,542; lisp: 8,628; pascal: 5,885; ml: 5,544; perl: 5,312; makefile: 2,208; cs: 2,022; xml: 686; php: 212; csh: 117
file content (64 lines) | stat: -rw-r--r-- 2,074 bytes parent folder | download
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
61
62
63
64
; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/einline.prof -S | FileCheck %s

; Checks if both call and invoke can be inlined early if their inlined
; instances are hot in profile.

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

@_ZTIi = external constant i8*

; Function Attrs: uwtable
define void @_Z3foov() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !6 {
  %1 = alloca i8*
  %2 = alloca i32
  %3 = alloca i32, align 4
; CHECK-NOT: call
  call void @_ZL3barv(), !dbg !9
; CHECK-NOT: invoke
  invoke void @_ZL3barv()
          to label %4 unwind label %5, !dbg !10

; <label>:4:
  ret void

; <label>:5:
  %6 = landingpad { i8*, i32 }
          catch i8* bitcast (i8** @_ZTIi to i8*)
  ret void
}

; Function Attrs: nounwind uwtable
define internal void @_ZL3barv() !dbg !12 {
  ret void
}

; CHECK-LABEL: @recursive
define void @recursive() !dbg !13 {
; Recursive calls should not be early-inlined.
; CHECK-NOT: call void @recursive
; CHECK: call void @recursive
; CHECK: call void @recursive
; CHECK-NOT: call void @recursive
; CHECK: ret
  call void @recursive(), !dbg !14
  call void @recursive(), !dbg !15
  ret void
}

declare i32 @__gxx_personality_v0(...)

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

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
!1 = !DIFile(filename: "a", directory: "b/")
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(linkageName: "_Z3foov", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
!9 = !DILocation(line: 6, column: 3, scope: !6)
!10 = !DILocation(line: 8, column: 5, scope: !11)
!11 = distinct !DILexicalBlock(scope: !6, file: !1, line: 7, column: 7)
!12 = distinct !DISubprogram(linkageName: "_ZL3barv", scope: !1, file: !1, line: 20, scopeLine: 20, unit: !0)
!13 = distinct !DISubprogram(linkageName: "recursive", scope: !1, file: !1, line: 20, scopeLine: 20, unit: !0)
!14 = !DILocation(line: 21, column: 3, scope: !13)
!15 = !DILocation(line: 22, column: 3, scope: !13)