annotate test/CodeGen/AMDGPU/ipra.ll @ 146:3fc4d5c3e21e

set tail call flag for code segment in CGCAll
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:23:36 +0900
parents 3a76565eade5
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -enable-ipra -amdgpu-sroa=0 < %s | FileCheck -check-prefix=GCN %s
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -amdgpu-sroa=0 < %s | FileCheck -check-prefix=GCN %s
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; Kernels are not called, so there is no call preserved mask.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; GCN-LABEL: {{^}}kernel:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; GCN: flat_store_dword
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 define amdgpu_kernel void @kernel(i32 addrspace(1)* %out) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 store i32 0, i32 addrspace(1)* %out
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; GCN-LABEL: {{^}}func:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; GCN: ; NumVgprs: 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 define void @func() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 call void asm sideeffect "", "~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7}"() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; GCN-LABEL: {{^}}kernel_call:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; GCN-NOT: buffer_store
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ; GCN-NOT: buffer_load
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 ; GCN-NOT: readlane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ; GCN-NOT: writelane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; GCN: flat_load_dword v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ; GCN: s_swappc_b64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 ; GCN-NOT: buffer_store
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ; GCN-NOT: buffer_load
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; GCN-NOT: readlane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 ; GCN-NOT: writelane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ; GCN: ; NumSgprs: 37
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 ; GCN: ; NumVgprs: 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 define amdgpu_kernel void @kernel_call() #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 %vgpr = load volatile i32, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 tail call void @func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 store volatile i32 %vgpr, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ; GCN-LABEL: {{^}}func_regular_call:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ; GCN-NOT: buffer_store
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ; GCN-NOT: buffer_load
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ; GCN-NOT: readlane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ; GCN-NOT: writelane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; GCN: flat_load_dword v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; GCN: s_swappc_b64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; GCN-NOT: buffer_store
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; GCN-NOT: buffer_load
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ; GCN-NOT: readlane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 ; GCN-NOT: writelane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 ; GCN: ; NumSgprs: 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ; GCN: ; NumVgprs: 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 define void @func_regular_call() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 %vgpr = load volatile i32, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 tail call void @func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 store volatile i32 %vgpr, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 ; GCN-LABEL: {{^}}func_tail_call:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 ; GCN: s_waitcnt
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ; GCN-NEXT: s_getpc_b64 s[6:7]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 ; GCN-NEXT: s_add_u32 s6,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 ; GCN-NEXT: s_addc_u32 s7,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 ; GCN-NEXT: s_setpc_b64 s[6:7]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 ; GCN: ; NumSgprs: 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 ; GCN: ; NumVgprs: 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 define void @func_tail_call() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 tail call void @func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 ; GCN-LABEL: {{^}}func_call_tail_call:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 ; GCN: flat_load_dword v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 ; GCN: s_swappc_b64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 ; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 ; GCN: s_setpc_b64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 ; GCN: ; NumSgprs: 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 ; GCN: ; NumVgprs: 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 define void @func_call_tail_call() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 %vgpr = load volatile i32, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 tail call void @func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 store volatile i32 %vgpr, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 tail call void @func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 define void @void_func_void() noinline {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 ; Make sure we don't get save/restore of FP between calls.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 ; GCN-LABEL: {{^}}test_funcx2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 ; GCN-NOT: s5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 ; GCN-NOT: s32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 define void @test_funcx2() #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 call void @void_func_void()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 call void @void_func_void()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 attributes #0 = { nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 attributes #1 = { nounwind noinline }