1 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN-NOHSA,FUNC %s
2 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn--amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN-HSA,FUNC %s
3 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN-NOHSA,FUNC %s
5 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=r600 -mcpu=redwood < %s | FileCheck --check-prefixes=EG,FUNC %s
6 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=r600 -mcpu=cayman < %s | FileCheck --check-prefixes=EG,FUNC %s
8 ; FUNC-LABEL: {{^}}global_load_i64:
9 ; GCN-NOHSA: buffer_load_dwordx2 [[VAL:v\[[0-9]+:[0-9]+\]]]
10 ; GCN-NOHSA: buffer_store_dwordx2 [[VAL]]
12 ; GCN-HSA: flat_load_dwordx2 [[VAL:v\[[0-9]+:[0-9]+\]]]
13 ; GCN-HSA: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, [[VAL]]
16 define amdgpu_kernel void @global_load_i64(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
17 %ld = load i64, ptr addrspace(1) %in
18 store i64 %ld, ptr addrspace(1) %out
22 ; FUNC-LABEL: {{^}}global_load_v2i64:
23 ; GCN-NOHSA: buffer_load_dwordx4
24 ; GCN-HSA: flat_load_dwordx4
27 define amdgpu_kernel void @global_load_v2i64(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
29 %ld = load <2 x i64>, ptr addrspace(1) %in
30 store <2 x i64> %ld, ptr addrspace(1) %out
34 ; FUNC-LABEL: {{^}}global_load_v3i64:
35 ; GCN-NOHSA-DAG: buffer_load_dwordx4
36 ; GCN-NOHSA-DAG: buffer_load_dwordx2
38 ; GCN-HSA-DAG: flat_load_dwordx4
39 ; GCN-HSA-DAG: flat_load_dwordx2
43 define amdgpu_kernel void @global_load_v3i64(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
45 %ld = load <3 x i64>, ptr addrspace(1) %in
46 store <3 x i64> %ld, ptr addrspace(1) %out
50 ; FUNC-LABEL: {{^}}global_load_v4i64:
51 ; GCN-NOHSA: buffer_load_dwordx4
52 ; GCN-NOHSA: buffer_load_dwordx4
54 ; GCN-HSA: flat_load_dwordx4
55 ; GCN-HSA: flat_load_dwordx4
59 define amdgpu_kernel void @global_load_v4i64(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
61 %ld = load <4 x i64>, ptr addrspace(1) %in
62 store <4 x i64> %ld, ptr addrspace(1) %out
66 ; FUNC-LABEL: {{^}}global_load_v8i64:
67 ; GCN-NOHSA: buffer_load_dwordx4
68 ; GCN-NOHSA: buffer_load_dwordx4
69 ; GCN-NOHSA: buffer_load_dwordx4
70 ; GCN-NOHSA: buffer_load_dwordx4
72 ; GCN-HSA: flat_load_dwordx4
73 ; GCN-HSA: flat_load_dwordx4
74 ; GCN-HSA: flat_load_dwordx4
75 ; GCN-HSA: flat_load_dwordx4
81 define amdgpu_kernel void @global_load_v8i64(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
83 %ld = load <8 x i64>, ptr addrspace(1) %in
84 store <8 x i64> %ld, ptr addrspace(1) %out
88 ; FUNC-LABEL: {{^}}global_load_v16i64:
89 ; GCN-NOHSA: buffer_load_dwordx4
90 ; GCN-NOHSA: buffer_load_dwordx4
91 ; GCN-NOHSA: buffer_load_dwordx4
92 ; GCN-NOHSA: buffer_load_dwordx4
93 ; GCN-NOHSA: buffer_load_dwordx4
94 ; GCN-NOHSA: buffer_load_dwordx4
95 ; GCN-NOHSA: buffer_load_dwordx4
96 ; GCN-NOHSA: buffer_load_dwordx4
98 ; GCN-HSA: flat_load_dwordx4
99 ; GCN-HSA: flat_load_dwordx4
100 ; GCN-HSA: flat_load_dwordx4
101 ; GCN-HSA: flat_load_dwordx4
102 ; GCN-HSA: flat_load_dwordx4
103 ; GCN-HSA: flat_load_dwordx4
104 ; GCN-HSA: flat_load_dwordx4
105 ; GCN-HSA: flat_load_dwordx4
115 define amdgpu_kernel void @global_load_v16i64(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
117 %ld = load <16 x i64>, ptr addrspace(1) %in
118 store <16 x i64> %ld, ptr addrspace(1) %out
122 attributes #0 = { nounwind }