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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=amdgcn -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck --check-prefix=GCN %s
define amdgpu_kernel void @divergent_or3_b32(ptr addrspace(1) %arg) {
; GCN-LABEL: divergent_or3_b32:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
; GCN-NEXT: v_lshlrev_b32_e32 v3, 4, v0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: global_load_dwordx3 v[0:2], v3, s[0:1]
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: v_or3_b32 v0, v1, v0, v2
; GCN-NEXT: v_not_b32_e32 v0, v0
; GCN-NEXT: global_store_dword v3, v0, s[0:1]
; GCN-NEXT: s_endpgm
bb:
%i = tail call i32 @llvm.amdgcn.workitem.id.x()
%i1 = zext i32 %i to i64
%i2 = getelementptr inbounds <3 x i32>, ptr addrspace(1) %arg, i64 %i1
%i3 = load <3 x i32>, ptr addrspace(1) %i2, align 16
%i4 = extractelement <3 x i32> %i3, i64 0
%i5 = extractelement <3 x i32> %i3, i64 1
%i6 = extractelement <3 x i32> %i3, i64 2
%i7 = or i32 %i5, %i4
%i8 = or i32 %i7, %i6
%i9 = xor i32 %i8, -1
store i32 %i9, ptr addrspace(1) %i2, align 16
ret void
}
define amdgpu_kernel void @divergent_or3_b64(ptr addrspace(1) %arg) {
; GCN-LABEL: divergent_or3_b64:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
; GCN-NEXT: v_lshlrev_b32_e32 v6, 5, v0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: global_load_dwordx2 v[4:5], v6, s[0:1] offset:16
; GCN-NEXT: global_load_dwordx4 v[0:3], v6, s[0:1]
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: v_or3_b32 v1, v3, v1, v5
; GCN-NEXT: v_or3_b32 v0, v2, v0, v4
; GCN-NEXT: v_not_b32_e32 v1, v1
; GCN-NEXT: v_not_b32_e32 v0, v0
; GCN-NEXT: global_store_dwordx2 v6, v[0:1], s[0:1]
; GCN-NEXT: s_endpgm
bb:
%i = tail call i32 @llvm.amdgcn.workitem.id.x()
%i1 = zext i32 %i to i64
%i2 = getelementptr inbounds <3 x i64>, ptr addrspace(1) %arg, i64 %i1
%i3 = load <3 x i64>, ptr addrspace(1) %i2, align 32
%i4 = extractelement <3 x i64> %i3, i64 0
%i5 = extractelement <3 x i64> %i3, i64 1
%i6 = extractelement <3 x i64> %i3, i64 2
%i7 = or i64 %i5, %i4
%i8 = or i64 %i7, %i6
%i9 = xor i64 %i8, -1
store i64 %i9, ptr addrspace(1) %i2, align 32
ret void
}
define amdgpu_kernel void @divergent_and3_b32(ptr addrspace(1) %arg) {
; GCN-LABEL: divergent_and3_b32:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
; GCN-NEXT: v_lshlrev_b32_e32 v3, 4, v0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: global_load_dwordx3 v[0:2], v3, s[0:1]
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: v_and_b32_e32 v0, v1, v0
; GCN-NEXT: v_and_b32_e32 v0, v0, v2
; GCN-NEXT: v_not_b32_e32 v0, v0
; GCN-NEXT: global_store_dword v3, v0, s[0:1]
; GCN-NEXT: s_endpgm
bb:
%i = tail call i32 @llvm.amdgcn.workitem.id.x()
%i1 = zext i32 %i to i64
%i2 = getelementptr inbounds <3 x i32>, ptr addrspace(1) %arg, i64 %i1
%i3 = load <3 x i32>, ptr addrspace(1) %i2, align 16
%i4 = extractelement <3 x i32> %i3, i64 0
%i5 = extractelement <3 x i32> %i3, i64 1
%i6 = extractelement <3 x i32> %i3, i64 2
%i7 = and i32 %i5, %i4
%i8 = and i32 %i7, %i6
%i9 = xor i32 %i8, -1
store i32 %i9, ptr addrspace(1) %i2, align 16
ret void
}
define amdgpu_kernel void @divergent_and3_b64(ptr addrspace(1) %arg) {
; GCN-LABEL: divergent_and3_b64:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
; GCN-NEXT: v_lshlrev_b32_e32 v6, 5, v0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: global_load_dwordx4 v[0:3], v6, s[0:1]
; GCN-NEXT: global_load_dwordx2 v[4:5], v6, s[0:1] offset:16
; GCN-NEXT: s_waitcnt vmcnt(1)
; GCN-NEXT: v_and_b32_e32 v1, v3, v1
; GCN-NEXT: v_and_b32_e32 v0, v2, v0
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: v_and_b32_e32 v1, v1, v5
; GCN-NEXT: v_and_b32_e32 v0, v0, v4
; GCN-NEXT: v_not_b32_e32 v1, v1
; GCN-NEXT: v_not_b32_e32 v0, v0
; GCN-NEXT: global_store_dwordx2 v6, v[0:1], s[0:1]
; GCN-NEXT: s_endpgm
bb:
%i = tail call i32 @llvm.amdgcn.workitem.id.x()
%i1 = zext i32 %i to i64
%i2 = getelementptr inbounds <3 x i64>, ptr addrspace(1) %arg, i64 %i1
%i3 = load <3 x i64>, ptr addrspace(1) %i2, align 32
%i4 = extractelement <3 x i64> %i3, i64 0
%i5 = extractelement <3 x i64> %i3, i64 1
%i6 = extractelement <3 x i64> %i3, i64 2
%i7 = and i64 %i5, %i4
%i8 = and i64 %i7, %i6
%i9 = xor i64 %i8, -1
store i64 %i9, ptr addrspace(1) %i2, align 32
ret void
}
define amdgpu_kernel void @divergent_xor3_b32(ptr addrspace(1) %arg) {
; GCN-LABEL: divergent_xor3_b32:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
; GCN-NEXT: v_lshlrev_b32_e32 v3, 4, v0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: global_load_dwordx3 v[0:2], v3, s[0:1]
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: v_xor_b32_e32 v0, v1, v0
; GCN-NEXT: v_xnor_b32_e32 v0, v0, v2
; GCN-NEXT: global_store_dword v3, v0, s[0:1]
; GCN-NEXT: s_endpgm
bb:
%i = tail call i32 @llvm.amdgcn.workitem.id.x()
%i1 = zext i32 %i to i64
%i2 = getelementptr inbounds <3 x i32>, ptr addrspace(1) %arg, i64 %i1
%i3 = load <3 x i32>, ptr addrspace(1) %i2, align 16
%i4 = extractelement <3 x i32> %i3, i64 0
%i5 = extractelement <3 x i32> %i3, i64 1
%i6 = extractelement <3 x i32> %i3, i64 2
%i7 = xor i32 %i5, %i4
%i8 = xor i32 %i7, %i6
%i9 = xor i32 %i8, -1
store i32 %i9, ptr addrspace(1) %i2, align 16
ret void
}
define amdgpu_kernel void @divergent_xor3_b64(ptr addrspace(1) %arg) {
; GCN-LABEL: divergent_xor3_b64:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
; GCN-NEXT: v_lshlrev_b32_e32 v6, 5, v0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: global_load_dwordx4 v[0:3], v6, s[0:1]
; GCN-NEXT: global_load_dwordx2 v[4:5], v6, s[0:1] offset:16
; GCN-NEXT: s_waitcnt vmcnt(1)
; GCN-NEXT: v_xor_b32_e32 v1, v3, v1
; GCN-NEXT: v_xor_b32_e32 v0, v2, v0
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: v_xnor_b32_e32 v1, v1, v5
; GCN-NEXT: v_xnor_b32_e32 v0, v0, v4
; GCN-NEXT: global_store_dwordx2 v6, v[0:1], s[0:1]
; GCN-NEXT: s_endpgm
bb:
%i = tail call i32 @llvm.amdgcn.workitem.id.x()
%i1 = zext i32 %i to i64
%i2 = getelementptr inbounds <3 x i64>, ptr addrspace(1) %arg, i64 %i1
%i3 = load <3 x i64>, ptr addrspace(1) %i2, align 32
%i4 = extractelement <3 x i64> %i3, i64 0
%i5 = extractelement <3 x i64> %i3, i64 1
%i6 = extractelement <3 x i64> %i3, i64 2
%i7 = xor i64 %i5, %i4
%i8 = xor i64 %i7, %i6
%i9 = xor i64 %i8, -1
store i64 %i9, ptr addrspace(1) %i2, align 32
ret void
}
define amdgpu_kernel void @uniform_or3_b32(ptr addrspace(1) %arg) {
; GCN-LABEL: uniform_or3_b32:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
; GCN-NEXT: v_mov_b32_e32 v0, 0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_or_b32 s0, s1, s0
; GCN-NEXT: s_nor_b32 s0, s0, s2
; GCN-NEXT: v_mov_b32_e32 v1, s0
; GCN-NEXT: global_store_dword v0, v1, s[4:5]
; GCN-NEXT: s_endpgm
bb:
%i3 = load <3 x i32>, ptr addrspace(1) %arg, align 16
%i4 = extractelement <3 x i32> %i3, i64 0
%i5 = extractelement <3 x i32> %i3, i64 1
%i6 = extractelement <3 x i32> %i3, i64 2
%i7 = or i32 %i5, %i4
%i8 = or i32 %i7, %i6
%i9 = xor i32 %i8, -1
store i32 %i9, ptr addrspace(1) %arg, align 16
ret void
}
define amdgpu_kernel void @uniform_or3_b64(ptr addrspace(1) %arg) {
; GCN-LABEL: uniform_or3_b64:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
; GCN-NEXT: v_mov_b32_e32 v2, 0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
; GCN-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x10
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_or_b64 s[0:1], s[2:3], s[0:1]
; GCN-NEXT: s_nor_b64 s[0:1], s[0:1], s[6:7]
; GCN-NEXT: v_mov_b32_e32 v0, s0
; GCN-NEXT: v_mov_b32_e32 v1, s1
; GCN-NEXT: global_store_dwordx2 v2, v[0:1], s[4:5]
; GCN-NEXT: s_endpgm
bb:
%i3 = load <3 x i64>, ptr addrspace(1) %arg, align 32
%i4 = extractelement <3 x i64> %i3, i64 0
%i5 = extractelement <3 x i64> %i3, i64 1
%i6 = extractelement <3 x i64> %i3, i64 2
%i7 = or i64 %i5, %i4
%i8 = or i64 %i7, %i6
%i9 = xor i64 %i8, -1
store i64 %i9, ptr addrspace(1) %arg, align 32
ret void
}
define amdgpu_kernel void @uniform_and3_b32(ptr addrspace(1) %arg) {
; GCN-LABEL: uniform_and3_b32:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
; GCN-NEXT: v_mov_b32_e32 v0, 0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_and_b32 s0, s1, s0
; GCN-NEXT: s_nand_b32 s0, s0, s2
; GCN-NEXT: v_mov_b32_e32 v1, s0
; GCN-NEXT: global_store_dword v0, v1, s[4:5]
; GCN-NEXT: s_endpgm
bb:
%i3 = load <3 x i32>, ptr addrspace(1) %arg, align 16
%i4 = extractelement <3 x i32> %i3, i64 0
%i5 = extractelement <3 x i32> %i3, i64 1
%i6 = extractelement <3 x i32> %i3, i64 2
%i7 = and i32 %i5, %i4
%i8 = and i32 %i7, %i6
%i9 = xor i32 %i8, -1
store i32 %i9, ptr addrspace(1) %arg, align 16
ret void
}
define amdgpu_kernel void @uniform_and3_b64(ptr addrspace(1) %arg) {
; GCN-LABEL: uniform_and3_b64:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
; GCN-NEXT: v_mov_b32_e32 v2, 0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
; GCN-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x10
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_and_b64 s[0:1], s[2:3], s[0:1]
; GCN-NEXT: s_nand_b64 s[0:1], s[0:1], s[6:7]
; GCN-NEXT: v_mov_b32_e32 v0, s0
; GCN-NEXT: v_mov_b32_e32 v1, s1
; GCN-NEXT: global_store_dwordx2 v2, v[0:1], s[4:5]
; GCN-NEXT: s_endpgm
bb:
%i3 = load <3 x i64>, ptr addrspace(1) %arg, align 32
%i4 = extractelement <3 x i64> %i3, i64 0
%i5 = extractelement <3 x i64> %i3, i64 1
%i6 = extractelement <3 x i64> %i3, i64 2
%i7 = and i64 %i5, %i4
%i8 = and i64 %i7, %i6
%i9 = xor i64 %i8, -1
store i64 %i9, ptr addrspace(1) %arg, align 32
ret void
}
define amdgpu_kernel void @uniform_xor3_b32(ptr addrspace(1) %arg) {
; GCN-LABEL: uniform_xor3_b32:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
; GCN-NEXT: v_mov_b32_e32 v0, 0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_xor_b32 s0, s1, s0
; GCN-NEXT: s_xnor_b32 s0, s0, s2
; GCN-NEXT: v_mov_b32_e32 v1, s0
; GCN-NEXT: global_store_dword v0, v1, s[4:5]
; GCN-NEXT: s_endpgm
bb:
%i3 = load <3 x i32>, ptr addrspace(1) %arg, align 16
%i4 = extractelement <3 x i32> %i3, i64 0
%i5 = extractelement <3 x i32> %i3, i64 1
%i6 = extractelement <3 x i32> %i3, i64 2
%i7 = xor i32 %i5, %i4
%i8 = xor i32 %i7, %i6
%i9 = xor i32 %i8, -1
store i32 %i9, ptr addrspace(1) %arg, align 16
ret void
}
define amdgpu_kernel void @uniform_xor3_b64(ptr addrspace(1) %arg) {
; GCN-LABEL: uniform_xor3_b64:
; GCN: ; %bb.0: ; %bb
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
; GCN-NEXT: v_mov_b32_e32 v2, 0
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x0
; GCN-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x10
; GCN-NEXT: s_waitcnt lgkmcnt(0)
; GCN-NEXT: s_xor_b64 s[0:1], s[2:3], s[0:1]
; GCN-NEXT: s_xnor_b64 s[0:1], s[0:1], s[6:7]
; GCN-NEXT: v_mov_b32_e32 v0, s0
; GCN-NEXT: v_mov_b32_e32 v1, s1
; GCN-NEXT: global_store_dwordx2 v2, v[0:1], s[4:5]
; GCN-NEXT: s_endpgm
bb:
%i3 = load <3 x i64>, ptr addrspace(1) %arg, align 32
%i4 = extractelement <3 x i64> %i3, i64 0
%i5 = extractelement <3 x i64> %i3, i64 1
%i6 = extractelement <3 x i64> %i3, i64 2
%i7 = xor i64 %i5, %i4
%i8 = xor i64 %i7, %i6
%i9 = xor i64 %i8, -1
store i64 %i9, ptr addrspace(1) %arg, align 32
ret void
}
declare i32 @llvm.amdgcn.workitem.id.x()
|