[InstCombine] Signed saturation patterns
[llvm-core.git] / test / CodeGen / AMDGPU / load-weird-sizes.ll
blobfff0d3520d74231a785dacc609c261df16d0c9e3
1 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI-NOHSA -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -mtriple=amdgcn-amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC -check-prefix=CI-HSA -check-prefix=SI %s
3 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=SI-NOHSA -check-prefix=SI -check-prefix=FUNC %s
4 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=EG -check-prefix=FUNC %s
5 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=r600 -mcpu=cayman < %s | FileCheck -check-prefix=R600 -check-prefix=CM -check-prefix=FUNC %s
7 ; FUNC-LABEL: {{^}}load_i24:
8 ; SI-DAG: {{flat|buffer}}_load_ubyte
9 ; SI-DAG: {{flat|buffer}}_load_ushort
10 ; SI: {{flat|buffer}}_store_dword
11 define amdgpu_kernel void @load_i24(i32 addrspace(1)* %out, i24 addrspace(1)* %in) #0 {
12   %1 = load i24, i24 addrspace(1)* %in
13   %2 = zext i24 %1 to i32
14   store i32 %2, i32 addrspace(1)* %out
15   ret void
18 ; FUNC-LABEL: {{^}}load_i25:
19 ; SI-NOHSA: buffer_load_dword [[VAL:v[0-9]+]]
20 ; SI-NOHSA: buffer_store_dword [[VAL]]
22 ; CI-HSA: flat_load_dword [[VAL:v[0-9]+]]
23 ; CI-HSA: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[VAL]]
24 define amdgpu_kernel void @load_i25(i32 addrspace(1)* %out, i25 addrspace(1)* %in) #0 {
25   %1 = load i25, i25 addrspace(1)* %in
26   %2 = zext i25 %1 to i32
27   store i32 %2, i32 addrspace(1)* %out
28   ret void
31 attributes #0 = { nounwind }