1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3 ; GCN-LABEL: {{^}}negated_cond:
5 ; GCN: v_cmp_eq_u32_e64 [[CC:[^,]+]],
7 ; GCN-NOT: v_cndmask_b32
9 ; GCN: s_andn2_b64 vcc, exec, [[CC]]
10 ; GCN: s_cbranch_vccnz BB0_2
11 define amdgpu_kernel void @negated_cond(i32 addrspace(1)* %arg1) {
16 %tmp1 = load i32, i32 addrspace(1)* %arg1
17 %tmp2 = icmp eq i32 %tmp1, 0
21 %tmp3 = phi i32 [ 0, %bb1 ], [ %tmp6, %bb4 ]
22 %tmp4 = shl i32 %tmp3, 5
23 br i1 %tmp2, label %bb3, label %bb4
26 %tmp5 = add i32 %tmp4, 1
30 %tmp6 = phi i32 [ %tmp5, %bb3 ], [ %tmp4, %bb2 ]
31 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg1, i32 %tmp6
32 store i32 0, i32 addrspace(1)* %gep
33 %tmp7 = icmp eq i32 %tmp6, 32
34 br i1 %tmp7, label %bb1, label %bb2
37 ; GCN-LABEL: {{^}}negated_cond_dominated_blocks:
38 ; GCN: v_cmp_eq_u32_e64 [[CC:[^,]+]],
40 ; GCN-NOT: v_cndmask_b32
42 ; GCN: s_andn2_b64 vcc, exec, [[CC]]
43 ; GCN: s_cbranch_vccnz BB1_1
44 define amdgpu_kernel void @negated_cond_dominated_blocks(i32 addrspace(1)* %arg1) {
49 %tmp1 = load i32, i32 addrspace(1)* %arg1
50 %tmp2 = icmp eq i32 %tmp1, 0
57 %tmp3 = phi i32 [ 0, %bb2 ], [ %tmp7, %bb7 ]
58 %tmp4 = shl i32 %tmp3, 5
59 br i1 %tmp2, label %bb5, label %bb6
62 %tmp5 = add i32 %tmp4, 1
66 %tmp6 = add i32 %tmp3, 1
70 %tmp7 = phi i32 [ %tmp5, %bb5 ], [ %tmp6, %bb6 ]
71 %gep = getelementptr inbounds i32, i32 addrspace(1)* %arg1, i32 %tmp7
72 store i32 0, i32 addrspace(1)* %gep
73 %tmp8 = icmp eq i32 %tmp7, 32
74 br i1 %tmp8, label %bb3, label %bb4