annotate llvm/test/CodeGen/AMDGPU/frame-index-elimination.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 0572611fdcc8
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri -mattr=-promote-alloca -amdgpu-sroa=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CI %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -mattr=-promote-alloca -amdgpu-sroa=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9 %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; Test that non-entry function frame indices are expanded properly to
anatofuz
parents:
diff changeset
5 ; give an index relative to the scratch wave offset register
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 ; Materialize into a mov. Make sure there isn't an unnecessary copy.
anatofuz
parents:
diff changeset
8 ; GCN-LABEL: {{^}}func_mov_fi_i32:
anatofuz
parents:
diff changeset
9 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
10
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11 ; CI-NEXT: v_lshr_b32_e64 v0, s32, 6
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
12 ; GFX9-NEXT: v_lshrrev_b32_e64 v0, 6, s32
150
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 ; GCN-NOT: v_mov
anatofuz
parents:
diff changeset
15 ; GCN: ds_write_b32 v0, v0
anatofuz
parents:
diff changeset
16 define void @func_mov_fi_i32() #0 {
anatofuz
parents:
diff changeset
17 %alloca = alloca i32, addrspace(5)
anatofuz
parents:
diff changeset
18 store volatile i32 addrspace(5)* %alloca, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
19 ret void
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 ; Offset due to different objects
anatofuz
parents:
diff changeset
23 ; GCN-LABEL: {{^}}func_mov_fi_i32_offset:
anatofuz
parents:
diff changeset
24 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
25
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
26 ; CI-DAG: v_lshr_b32_e64 v0, s32, 6
150
anatofuz
parents:
diff changeset
27 ; CI-NOT: v_mov
anatofuz
parents:
diff changeset
28 ; CI: ds_write_b32 v0, v0
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
29 ; CI-NEXT: v_lshr_b32_e64 [[SCALED:v[0-9]+]], s32, 6
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
30 ; CI-NEXT: v_add_i32_e{{32|64}} v0, {{s\[[0-9]+:[0-9]+\]|vcc}}, 4, [[SCALED]]
150
anatofuz
parents:
diff changeset
31 ; CI-NEXT: ds_write_b32 v0, v0
anatofuz
parents:
diff changeset
32
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 ; GFX9: v_lshrrev_b32_e64 v0, 6, s32
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 ; GFX9-NEXT: ds_write_b32 v0, v0
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
35 ; GFX9-NEXT: v_lshrrev_b32_e64 [[SCALED:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
36 ; GFX9-NEXT: v_add_u32_e32 v0, 4, [[SCALED]]
anatofuz
parents:
diff changeset
37 ; GFX9-NEXT: ds_write_b32 v0, v0
anatofuz
parents:
diff changeset
38 define void @func_mov_fi_i32_offset() #0 {
anatofuz
parents:
diff changeset
39 %alloca0 = alloca i32, addrspace(5)
anatofuz
parents:
diff changeset
40 %alloca1 = alloca i32, addrspace(5)
anatofuz
parents:
diff changeset
41 store volatile i32 addrspace(5)* %alloca0, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
42 store volatile i32 addrspace(5)* %alloca1, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
43 ret void
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 ; Materialize into an add of a constant offset from the FI.
anatofuz
parents:
diff changeset
47 ; FIXME: Should be able to merge adds
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 ; GCN-LABEL: {{^}}func_add_constant_to_fi_i32:
anatofuz
parents:
diff changeset
50 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
51
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
52 ; CI: v_lshr_b32_e64 [[SCALED:v[0-9]+]], s32, 6
150
anatofuz
parents:
diff changeset
53 ; CI-NEXT: v_add_i32_e32 v0, vcc, 4, [[SCALED]]
anatofuz
parents:
diff changeset
54
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
55 ; GFX9: v_lshrrev_b32_e64 [[SCALED:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
56 ; GFX9-NEXT: v_add_u32_e32 v0, 4, [[SCALED]]
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 ; GCN-NOT: v_mov
anatofuz
parents:
diff changeset
59 ; GCN: ds_write_b32 v0, v0
anatofuz
parents:
diff changeset
60 define void @func_add_constant_to_fi_i32() #0 {
anatofuz
parents:
diff changeset
61 %alloca = alloca [2 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
62 %gep0 = getelementptr inbounds [2 x i32], [2 x i32] addrspace(5)* %alloca, i32 0, i32 1
anatofuz
parents:
diff changeset
63 store volatile i32 addrspace(5)* %gep0, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
64 ret void
anatofuz
parents:
diff changeset
65 }
anatofuz
parents:
diff changeset
66
anatofuz
parents:
diff changeset
67 ; A user the materialized frame index can't be meaningfully folded
anatofuz
parents:
diff changeset
68 ; into.
anatofuz
parents:
diff changeset
69
anatofuz
parents:
diff changeset
70 ; GCN-LABEL: {{^}}func_other_fi_user_i32:
anatofuz
parents:
diff changeset
71
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
72 ; CI: v_lshr_b32_e64 v0, s32, 6
150
anatofuz
parents:
diff changeset
73
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
74 ; GFX9: v_lshrrev_b32_e64 v0, 6, s32
150
anatofuz
parents:
diff changeset
75
anatofuz
parents:
diff changeset
76 ; GCN-NEXT: v_mul_u32_u24_e32 v0, 9, v0
anatofuz
parents:
diff changeset
77 ; GCN-NOT: v_mov
anatofuz
parents:
diff changeset
78 ; GCN: ds_write_b32 v0, v0
anatofuz
parents:
diff changeset
79 define void @func_other_fi_user_i32() #0 {
anatofuz
parents:
diff changeset
80 %alloca = alloca [2 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
81 %ptrtoint = ptrtoint [2 x i32] addrspace(5)* %alloca to i32
anatofuz
parents:
diff changeset
82 %mul = mul i32 %ptrtoint, 9
anatofuz
parents:
diff changeset
83 store volatile i32 %mul, i32 addrspace(3)* undef
anatofuz
parents:
diff changeset
84 ret void
anatofuz
parents:
diff changeset
85 }
anatofuz
parents:
diff changeset
86
anatofuz
parents:
diff changeset
87 ; GCN-LABEL: {{^}}func_store_private_arg_i32_ptr:
anatofuz
parents:
diff changeset
88 ; GCN: v_mov_b32_e32 v1, 15{{$}}
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
89 ; GCN: buffer_store_dword v1, v0, s[0:3], 0 offen{{$}}
150
anatofuz
parents:
diff changeset
90 define void @func_store_private_arg_i32_ptr(i32 addrspace(5)* %ptr) #0 {
anatofuz
parents:
diff changeset
91 store volatile i32 15, i32 addrspace(5)* %ptr
anatofuz
parents:
diff changeset
92 ret void
anatofuz
parents:
diff changeset
93 }
anatofuz
parents:
diff changeset
94
anatofuz
parents:
diff changeset
95 ; GCN-LABEL: {{^}}func_load_private_arg_i32_ptr:
anatofuz
parents:
diff changeset
96 ; GCN: s_waitcnt
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
97 ; GCN-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen{{$}}
150
anatofuz
parents:
diff changeset
98 define void @func_load_private_arg_i32_ptr(i32 addrspace(5)* %ptr) #0 {
anatofuz
parents:
diff changeset
99 %val = load volatile i32, i32 addrspace(5)* %ptr
anatofuz
parents:
diff changeset
100 ret void
anatofuz
parents:
diff changeset
101 }
anatofuz
parents:
diff changeset
102
anatofuz
parents:
diff changeset
103 ; GCN-LABEL: {{^}}void_func_byval_struct_i8_i32_ptr:
anatofuz
parents:
diff changeset
104 ; GCN: s_waitcnt
anatofuz
parents:
diff changeset
105
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
106 ; CI: v_lshr_b32_e64 [[SHIFT:v[0-9]+]], s32, 6
150
anatofuz
parents:
diff changeset
107 ; CI-NEXT: v_or_b32_e32 v0, 4, [[SHIFT]]
anatofuz
parents:
diff changeset
108
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
109 ; GFX9: v_lshrrev_b32_e64 [[SHIFT:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
110 ; GFX9-NEXT: v_or_b32_e32 v0, 4, [[SHIFT]]
anatofuz
parents:
diff changeset
111
anatofuz
parents:
diff changeset
112 ; GCN-NOT: v_mov
anatofuz
parents:
diff changeset
113 ; GCN: ds_write_b32 v0, v0
anatofuz
parents:
diff changeset
114 define void @void_func_byval_struct_i8_i32_ptr({ i8, i32 } addrspace(5)* byval %arg0) #0 {
anatofuz
parents:
diff changeset
115 %gep0 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %arg0, i32 0, i32 0
anatofuz
parents:
diff changeset
116 %gep1 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %arg0, i32 0, i32 1
anatofuz
parents:
diff changeset
117 %load1 = load i32, i32 addrspace(5)* %gep1
anatofuz
parents:
diff changeset
118 store volatile i32 addrspace(5)* %gep1, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
119 ret void
anatofuz
parents:
diff changeset
120 }
anatofuz
parents:
diff changeset
121
anatofuz
parents:
diff changeset
122 ; GCN-LABEL: {{^}}void_func_byval_struct_i8_i32_ptr_value:
anatofuz
parents:
diff changeset
123 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
124 ; GCN-NEXT: buffer_load_ubyte v0, off, s[0:3], s32
anatofuz
parents:
diff changeset
125 ; GCN_NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:4
anatofuz
parents:
diff changeset
126 define void @void_func_byval_struct_i8_i32_ptr_value({ i8, i32 } addrspace(5)* byval %arg0) #0 {
anatofuz
parents:
diff changeset
127 %gep0 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %arg0, i32 0, i32 0
anatofuz
parents:
diff changeset
128 %gep1 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %arg0, i32 0, i32 1
anatofuz
parents:
diff changeset
129 %load0 = load i8, i8 addrspace(5)* %gep0
anatofuz
parents:
diff changeset
130 %load1 = load i32, i32 addrspace(5)* %gep1
anatofuz
parents:
diff changeset
131 store volatile i8 %load0, i8 addrspace(3)* undef
anatofuz
parents:
diff changeset
132 store volatile i32 %load1, i32 addrspace(3)* undef
anatofuz
parents:
diff changeset
133 ret void
anatofuz
parents:
diff changeset
134 }
anatofuz
parents:
diff changeset
135
anatofuz
parents:
diff changeset
136 ; GCN-LABEL: {{^}}void_func_byval_struct_i8_i32_ptr_nonentry_block:
anatofuz
parents:
diff changeset
137
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
138 ; CI: v_lshr_b32_e64 [[SHIFT:v[0-9]+]], s32, 6
150
anatofuz
parents:
diff changeset
139
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
140 ; GFX9: v_lshrrev_b32_e64 [[SHIFT:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
141
anatofuz
parents:
diff changeset
142 ; GCN: s_and_saveexec_b64
anatofuz
parents:
diff changeset
143
anatofuz
parents:
diff changeset
144 ; CI: v_add_i32_e32 [[GEP:v[0-9]+]], vcc, 4, [[SHIFT]]
anatofuz
parents:
diff changeset
145 ; CI: buffer_load_dword v{{[0-9]+}}, off, s[0:3], s32 offset:4{{$}}
anatofuz
parents:
diff changeset
146
anatofuz
parents:
diff changeset
147 ; GFX9: v_add_u32_e32 [[GEP:v[0-9]+]], 4, [[SHIFT]]
anatofuz
parents:
diff changeset
148 ; GFX9: buffer_load_dword v{{[0-9]+}}, off, s[0:3], s32 offset:4{{$}}
anatofuz
parents:
diff changeset
149
anatofuz
parents:
diff changeset
150 ; GCN: ds_write_b32 v{{[0-9]+}}, [[GEP]]
anatofuz
parents:
diff changeset
151 define void @void_func_byval_struct_i8_i32_ptr_nonentry_block({ i8, i32 } addrspace(5)* byval %arg0, i32 %arg2) #0 {
anatofuz
parents:
diff changeset
152 %cmp = icmp eq i32 %arg2, 0
anatofuz
parents:
diff changeset
153 br i1 %cmp, label %bb, label %ret
anatofuz
parents:
diff changeset
154
anatofuz
parents:
diff changeset
155 bb:
anatofuz
parents:
diff changeset
156 %gep0 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %arg0, i32 0, i32 0
anatofuz
parents:
diff changeset
157 %gep1 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %arg0, i32 0, i32 1
anatofuz
parents:
diff changeset
158 %load1 = load volatile i32, i32 addrspace(5)* %gep1
anatofuz
parents:
diff changeset
159 store volatile i32 addrspace(5)* %gep1, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
160 br label %ret
anatofuz
parents:
diff changeset
161
anatofuz
parents:
diff changeset
162 ret:
anatofuz
parents:
diff changeset
163 ret void
anatofuz
parents:
diff changeset
164 }
anatofuz
parents:
diff changeset
165
anatofuz
parents:
diff changeset
166 ; Added offset can't be used with VOP3 add
anatofuz
parents:
diff changeset
167 ; GCN-LABEL: {{^}}func_other_fi_user_non_inline_imm_offset_i32:
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
168
150
anatofuz
parents:
diff changeset
169 ; CI-DAG: s_movk_i32 [[K:s[0-9]+|vcc_lo|vcc_hi]], 0x200
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
170 ; CI-DAG: v_lshr_b32_e64 [[SCALED:v[0-9]+]], s32, 6
150
anatofuz
parents:
diff changeset
171 ; CI: v_add_i32_e32 [[VZ:v[0-9]+]], vcc, [[K]], [[SCALED]]
anatofuz
parents:
diff changeset
172
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
173 ; GFX9-DAG: v_lshrrev_b32_e64 [[SCALED:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
174 ; GFX9: v_add_u32_e32 [[VZ:v[0-9]+]], 0x200, [[SCALED]]
anatofuz
parents:
diff changeset
175
anatofuz
parents:
diff changeset
176 ; GCN: v_mul_u32_u24_e32 [[VZ]], 9, [[VZ]]
anatofuz
parents:
diff changeset
177 ; GCN: ds_write_b32 v0, [[VZ]]
anatofuz
parents:
diff changeset
178 define void @func_other_fi_user_non_inline_imm_offset_i32() #0 {
anatofuz
parents:
diff changeset
179 %alloca0 = alloca [128 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
180 %alloca1 = alloca [8 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
181 %gep0 = getelementptr inbounds [128 x i32], [128 x i32] addrspace(5)* %alloca0, i32 0, i32 65
anatofuz
parents:
diff changeset
182 %gep1 = getelementptr inbounds [8 x i32], [8 x i32] addrspace(5)* %alloca1, i32 0, i32 0
anatofuz
parents:
diff changeset
183 store volatile i32 7, i32 addrspace(5)* %gep0
anatofuz
parents:
diff changeset
184 %ptrtoint = ptrtoint i32 addrspace(5)* %gep1 to i32
anatofuz
parents:
diff changeset
185 %mul = mul i32 %ptrtoint, 9
anatofuz
parents:
diff changeset
186 store volatile i32 %mul, i32 addrspace(3)* undef
anatofuz
parents:
diff changeset
187 ret void
anatofuz
parents:
diff changeset
188 }
anatofuz
parents:
diff changeset
189
anatofuz
parents:
diff changeset
190 ; GCN-LABEL: {{^}}func_other_fi_user_non_inline_imm_offset_i32_vcc_live:
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
191
150
anatofuz
parents:
diff changeset
192 ; CI-DAG: s_movk_i32 [[OFFSET:s[0-9]+]], 0x200
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
193 ; CI-DAG: v_lshr_b32_e64 [[SCALED:v[0-9]+]], s32, 6
150
anatofuz
parents:
diff changeset
194 ; CI: v_add_i32_e64 [[VZ:v[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, [[OFFSET]], [[SCALED]]
anatofuz
parents:
diff changeset
195
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
196 ; GFX9-DAG: v_lshrrev_b32_e64 [[SCALED:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
197 ; GFX9: v_add_u32_e32 [[VZ:v[0-9]+]], 0x200, [[SCALED]]
anatofuz
parents:
diff changeset
198
anatofuz
parents:
diff changeset
199 ; GCN: v_mul_u32_u24_e32 [[VZ]], 9, [[VZ]]
anatofuz
parents:
diff changeset
200 ; GCN: ds_write_b32 v0, [[VZ]]
anatofuz
parents:
diff changeset
201 define void @func_other_fi_user_non_inline_imm_offset_i32_vcc_live() #0 {
anatofuz
parents:
diff changeset
202 %alloca0 = alloca [128 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
203 %alloca1 = alloca [8 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
204 %vcc = call i64 asm sideeffect "; def $0", "={vcc}"()
anatofuz
parents:
diff changeset
205 %gep0 = getelementptr inbounds [128 x i32], [128 x i32] addrspace(5)* %alloca0, i32 0, i32 65
anatofuz
parents:
diff changeset
206 %gep1 = getelementptr inbounds [8 x i32], [8 x i32] addrspace(5)* %alloca1, i32 0, i32 0
anatofuz
parents:
diff changeset
207 store volatile i32 7, i32 addrspace(5)* %gep0
anatofuz
parents:
diff changeset
208 call void asm sideeffect "; use $0", "{vcc}"(i64 %vcc)
anatofuz
parents:
diff changeset
209 %ptrtoint = ptrtoint i32 addrspace(5)* %gep1 to i32
anatofuz
parents:
diff changeset
210 %mul = mul i32 %ptrtoint, 9
anatofuz
parents:
diff changeset
211 store volatile i32 %mul, i32 addrspace(3)* undef
anatofuz
parents:
diff changeset
212 ret void
anatofuz
parents:
diff changeset
213 }
anatofuz
parents:
diff changeset
214
anatofuz
parents:
diff changeset
215 declare void @func(<4 x float> addrspace(5)* nocapture) #0
anatofuz
parents:
diff changeset
216
anatofuz
parents:
diff changeset
217 ; undef flag not preserved in eliminateFrameIndex when handling the
anatofuz
parents:
diff changeset
218 ; stores in the middle block.
anatofuz
parents:
diff changeset
219
anatofuz
parents:
diff changeset
220 ; GCN-LABEL: {{^}}undefined_stack_store_reg:
anatofuz
parents:
diff changeset
221 ; GCN: s_and_saveexec_b64
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
222 ; GCN: buffer_store_dword v0, off, s[0:3], s33 offset:
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
223 ; GCN: buffer_store_dword v0, off, s[0:3], s33 offset:
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
224 ; GCN: buffer_store_dword v0, off, s[0:3], s33 offset:
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
225 ; GCN: buffer_store_dword v{{[0-9]+}}, off, s[0:3], s33 offset:
150
anatofuz
parents:
diff changeset
226 define void @undefined_stack_store_reg(float %arg, i32 %arg1) #0 {
anatofuz
parents:
diff changeset
227 bb:
anatofuz
parents:
diff changeset
228 %tmp = alloca <4 x float>, align 16, addrspace(5)
anatofuz
parents:
diff changeset
229 %tmp2 = insertelement <4 x float> undef, float %arg, i32 0
anatofuz
parents:
diff changeset
230 store <4 x float> %tmp2, <4 x float> addrspace(5)* undef
anatofuz
parents:
diff changeset
231 %tmp3 = icmp eq i32 %arg1, 0
anatofuz
parents:
diff changeset
232 br i1 %tmp3, label %bb4, label %bb5
anatofuz
parents:
diff changeset
233
anatofuz
parents:
diff changeset
234 bb4:
anatofuz
parents:
diff changeset
235 call void @func(<4 x float> addrspace(5)* nonnull undef)
anatofuz
parents:
diff changeset
236 store <4 x float> %tmp2, <4 x float> addrspace(5)* %tmp, align 16
anatofuz
parents:
diff changeset
237 call void @func(<4 x float> addrspace(5)* nonnull %tmp)
anatofuz
parents:
diff changeset
238 br label %bb5
anatofuz
parents:
diff changeset
239
anatofuz
parents:
diff changeset
240 bb5:
anatofuz
parents:
diff changeset
241 ret void
anatofuz
parents:
diff changeset
242 }
anatofuz
parents:
diff changeset
243
anatofuz
parents:
diff changeset
244 ; GCN-LABEL: {{^}}alloca_ptr_nonentry_block:
anatofuz
parents:
diff changeset
245 ; GCN: s_and_saveexec_b64
anatofuz
parents:
diff changeset
246 ; GCN: buffer_load_dword v{{[0-9]+}}, off, s[0:3], s32 offset:4
anatofuz
parents:
diff changeset
247
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
248 ; CI: v_lshr_b32_e64 [[SHIFT:v[0-9]+]], s32, 6
150
anatofuz
parents:
diff changeset
249 ; CI-NEXT: v_or_b32_e32 [[PTR:v[0-9]+]], 4, [[SHIFT]]
anatofuz
parents:
diff changeset
250
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
251 ; GFX9: v_lshrrev_b32_e64 [[SHIFT:v[0-9]+]], 6, s32
150
anatofuz
parents:
diff changeset
252 ; GFX9-NEXT: v_or_b32_e32 [[PTR:v[0-9]+]], 4, [[SHIFT]]
anatofuz
parents:
diff changeset
253
anatofuz
parents:
diff changeset
254 ; GCN: ds_write_b32 v{{[0-9]+}}, [[PTR]]
anatofuz
parents:
diff changeset
255 define void @alloca_ptr_nonentry_block(i32 %arg0) #0 {
anatofuz
parents:
diff changeset
256 %alloca0 = alloca { i8, i32 }, align 4, addrspace(5)
anatofuz
parents:
diff changeset
257 %cmp = icmp eq i32 %arg0, 0
anatofuz
parents:
diff changeset
258 br i1 %cmp, label %bb, label %ret
anatofuz
parents:
diff changeset
259
anatofuz
parents:
diff changeset
260 bb:
anatofuz
parents:
diff changeset
261 %gep0 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %alloca0, i32 0, i32 0
anatofuz
parents:
diff changeset
262 %gep1 = getelementptr inbounds { i8, i32 }, { i8, i32 } addrspace(5)* %alloca0, i32 0, i32 1
anatofuz
parents:
diff changeset
263 %load1 = load volatile i32, i32 addrspace(5)* %gep1
anatofuz
parents:
diff changeset
264 store volatile i32 addrspace(5)* %gep1, i32 addrspace(5)* addrspace(3)* undef
anatofuz
parents:
diff changeset
265 br label %ret
anatofuz
parents:
diff changeset
266
anatofuz
parents:
diff changeset
267 ret:
anatofuz
parents:
diff changeset
268 ret void
anatofuz
parents:
diff changeset
269 }
anatofuz
parents:
diff changeset
270
anatofuz
parents:
diff changeset
271 attributes #0 = { nounwind }