1 ; RUN: llc -mtriple=amdgcn -stop-after=amdgpu-isel < %s | FileCheck -check-prefix=GCN %s
2 ; RUN: llc -mtriple=amdgcn -enable-new-pm -stop-after=amdgpu-isel < %s | FileCheck -check-prefix=GCN %s
4 ; GCN-LABEL: name: uniform_imin
6 define amdgpu_kernel void @uniform_imin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
7 %cmp = icmp sle i32 %a, %b
8 %val = select i1 %cmp, i32 %a, i32 %b
9 store i32 %val, ptr addrspace(1) %out, align 4
13 ; GCN-LABEL: name: divergent_imin
15 define void @divergent_imin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
16 %cmp = icmp sle i32 %a, %b
17 %val = select i1 %cmp, i32 %a, i32 %b
18 store i32 %val, ptr addrspace(1) %out, align 4
22 ; GCN-LABEL: name: uniform_umin
24 define amdgpu_kernel void @uniform_umin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
25 %tmp = icmp ule i32 %a, %b
26 %val = select i1 %tmp, i32 %a, i32 %b
27 store i32 %val, ptr addrspace(1) %out, align 8
31 ; GCN-LABEL: name: divergent_umin
33 define void @divergent_umin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
34 %tmp = icmp ule i32 %a, %b
35 %val = select i1 %tmp, i32 %a, i32 %b
36 store i32 %val, ptr addrspace(1) %out, align 8
40 ; GCN-LABEL: name: uniform_imax
42 define amdgpu_kernel void @uniform_imax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
43 %cmp = icmp sge i32 %a, %b
44 %val = select i1 %cmp, i32 %a, i32 %b
45 store i32 %val, ptr addrspace(1) %out, align 4
49 ; GCN-LABEL: name: divergent_imax
51 define void @divergent_imax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
52 %cmp = icmp sge i32 %a, %b
53 %val = select i1 %cmp, i32 %a, i32 %b
54 store i32 %val, ptr addrspace(1) %out, align 4
58 ; GCN-LABEL: name: uniform_umax
60 define amdgpu_kernel void @uniform_umax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
61 %cmp = icmp uge i32 %a, %b
62 %val = select i1 %cmp, i32 %a, i32 %b
63 store i32 %val, ptr addrspace(1) %out, align 4
67 ; GCN-LABEL: name: divergent_umax
69 define void @divergent_umax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
70 %cmp = icmp uge i32 %a, %b
71 %val = select i1 %cmp, i32 %a, i32 %b
72 store i32 %val, ptr addrspace(1) %out, align 4