2
2
3
3
; This test checks that LowerESIMD pass sets the 'alwaysinline'
4
4
; attribute for all non-kernel functions.
5
+ ; If the function already has noinline attribute -- honor that.
5
6
6
7
define spir_kernel void @EsimdKernel1 () {
7
8
; CHECK: @EsimdKernel1(
@@ -15,25 +16,36 @@ define spir_kernel void @EsimdKernel1() {
15
16
define spir_kernel void @EsimdKernel2 () {
16
17
; CHECK: @EsimdKernel2(
17
18
; CHECK-NEXT: call void @foobar()
19
+ ; CHECK-NEXT: call void @noinline_func()
18
20
call void @foobar ()
21
+ call void @noinline_func ()
19
22
ret void
20
23
}
21
24
22
25
define spir_func void @foo () {
23
- ; CHECK: @foo() #[[ATTR :[0-9]+]]
26
+ ; CHECK: @foo() #[[ATTR_INL :[0-9]+]]
24
27
ret void
25
28
}
26
29
27
30
define spir_func void @bar () {
28
- ; CHECK: @bar() #[[ATTR ]]
31
+ ; CHECK: @bar() #[[ATTR_INL ]]
29
32
; CHECK-NEXT: call void @foobar
33
+ ; CHECK-NEXT: call void @noinline_func()
30
34
call void @foobar ()
35
+ call void @noinline_func ()
31
36
ret void
32
37
}
33
38
34
39
define spir_func void @foobar () {
35
- ; CHECK: @foobar() #[[ATTR ]]
40
+ ; CHECK: @foobar() #[[ATTR_INL ]]
36
41
ret void
37
42
}
38
43
39
- ; CHECK: attributes #[[ATTR]] = { alwaysinline }
44
+ define spir_func void @noinline_func () #0 {
45
+ ; CHECK: @noinline_func() #[[ATTR_NOINL:[0-9]+]] {
46
+ ret void
47
+ }
48
+
49
+ attributes #0 = { noinline }
50
+ ; CHECK-DAG: attributes #[[ATTR_INL]] = { alwaysinline }
51
+ ; CHECK-DAG: attributes #[[ATTR_NOINL]] = { noinline }
0 commit comments