File: resolve-static-ifunc.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (109 lines) | stat: -rw-r--r-- 3,303 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function caller --check-globals all --version 4
; RUN: opt --passes=globalopt -o - -S < %s | FileCheck %s --implicit-check-not=trivial\.ifunc --implicit-check-not=dead_ifunc

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"

@trivial.ifunc = internal ifunc void (), ptr @trivial.resolver
;.
; CHECK: @unknown_condition = external local_unnamed_addr global i1
; CHECK: @external_ifunc.ifunc = dso_local ifunc void (), ptr @external_ifunc.resolver
; CHECK: @complex.ifunc = internal ifunc void (), ptr @complex.resolver
; CHECK: @sideeffects.ifunc = internal ifunc void (), ptr @sideeffects.resolver
; CHECK: @interposable_ifunc.ifunc = internal ifunc void (), ptr @interposable_ifunc.resolver
; CHECK: @interposable_resolver.ifunc = weak ifunc void (), ptr @interposable_resolver.resolver
;.
define ptr @trivial.resolver() {
  ret ptr @trivial._Msimd
}
define void @trivial._Msimd() {
  ret void
}
define void @trivial.default() {
  ret void
}


@dead_ifunc.ifunc = internal ifunc void (), ptr @trivial.resolver

@external_ifunc.ifunc = dso_local ifunc void (), ptr @external_ifunc.resolver
define ptr @external_ifunc.resolver() {
  ret ptr @external_ifunc._Msimd
}
define void @external_ifunc._Msimd() {
  ret void
}
define void @external_ifunc.default() {
  ret void
}

@unknown_condition = external global i1
@complex.ifunc = internal ifunc void (), ptr @complex.resolver
define ptr @complex.resolver() {
entry:
  %v = load i1, ptr @unknown_condition
  br i1 %v, label %fast, label %slow
fast:
  ret ptr @complex._Msimd
slow:
  ret ptr @complex._Msimd
}
define void @complex._Msimd() {
  ret void
}
define void @complex.default() {
  ret void
}

@sideeffects.ifunc = internal ifunc void (), ptr @sideeffects.resolver
define ptr @sideeffects.resolver() {
  store i1 0, ptr @unknown_condition
  ret ptr @sideeffects.default
}
define void @sideeffects._Msimd() {
  ret void
}
define void @sideeffects.default() {
  ret void
}

@interposable_ifunc.ifunc = internal ifunc void (), ptr @interposable_ifunc.resolver
define weak ptr @interposable_ifunc.resolver() {
  ret ptr @interposable_ifunc.resolver
}
define void @interposable_ifunc._Msimd() {
  ret void
}
define void @interposable_ifunc.default() {
  ret void
}

@interposable_resolver.ifunc = weak ifunc void (), ptr @interposable_resolver.resolver
define ptr @interposable_resolver.resolver() {
  ret ptr @interposable_resolver.resolver
}
define void @interposable_resolver._Msimd() {
  ret void
}
define void @interposable_resolver.default() {
  ret void
}

define void @caller() {
; CHECK-LABEL: define void @caller() local_unnamed_addr {
; CHECK-NEXT:    call void @trivial._Msimd()
; CHECK-NEXT:    call void @external_ifunc._Msimd()
; CHECK-NEXT:    call void @complex.ifunc()
; CHECK-NEXT:    call void @sideeffects.ifunc()
; CHECK-NEXT:    call void @interposable_ifunc.ifunc()
; CHECK-NEXT:    call void @interposable_resolver.ifunc()
; CHECK-NEXT:    ret void
;
  call void @trivial.ifunc()
  call void @external_ifunc.ifunc()
  call void @complex.ifunc()
  call void @sideeffects.ifunc()
  call void @interposable_ifunc.ifunc()
  call void @interposable_resolver.ifunc()
  ret void
}