1 ; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
2 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
4 ; FUNC-LABEL: {{^}}break_inserted_outside_of_loop:
6 ; SI: [[LOOP_LABEL:[A-Z0-9]+]]:
7 ; Lowered break instructin:
9 ; Lowered Loop instruction:
11 ; s_cbranch_execnz [[LOOP_LABEL]]
13 define void @break_inserted_outside_of_loop(i32 addrspace(1)* %out, i32 %a, i32 %b) {
16 %1 = trunc i32 %0 to i1
20 store i32 0, i32 addrspace(1)* %out
24 br i1 %1, label %ENDLOOP, label %ENDIF
28 ; FUNC-LABEL: {{^}}phi_cond_outside_loop:
29 ; FIXME: This could be folded into the s_or_b64 instruction
30 ; SI: s_mov_b64 [[ZERO:s\[[0-9]+:[0-9]+\]]], 0
31 ; SI: [[LOOP_LABEL:[A-Z0-9]+]]
32 ; SI: v_cmp_ne_i32_e32 vcc, 0, v{{[0-9]+}}
34 ; SI_IF_BREAK instruction:
35 ; SI: s_or_b64 [[BREAK:s\[[0-9]+:[0-9]+\]]], vcc, [[ZERO]]
37 ; SI_LOOP instruction:
38 ; SI: s_andn2_b64 exec, exec, [[BREAK]]
39 ; SI: s_cbranch_execnz [[LOOP_LABEL]]
42 define void @phi_cond_outside_loop(i32 %a, i32 %b) {
44 %0 = icmp eq i32 %a , 0
45 br i1 %0, label %if, label %else
51 %1 = icmp eq i32 %b, 0
55 %2 = phi i1 [0, %if], [%1, %else]
59 br i1 %2, label %exit, label %loop