mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239657 91177308-0d34-0410-b5e6-96231b3b80d8
64 lines
1.4 KiB
LLVM
64 lines
1.4 KiB
LLVM
; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
|
|
; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
|
|
|
|
; FUNC-LABEL: {{^}}break_inserted_outside_of_loop:
|
|
|
|
; SI: [[LOOP_LABEL:[A-Z0-9]+]]:
|
|
; Lowered break instructin:
|
|
; SI: s_or_b64
|
|
; Lowered Loop instruction:
|
|
; SI: s_andn2_b64
|
|
; s_cbranch_execnz [[LOOP_LABEL]]
|
|
; SI: s_endpgm
|
|
define void @break_inserted_outside_of_loop(i32 addrspace(1)* %out, i32 %a, i32 %b) {
|
|
main_body:
|
|
%0 = and i32 %a, %b
|
|
%1 = trunc i32 %0 to i1
|
|
br label %ENDIF
|
|
|
|
ENDLOOP:
|
|
store i32 0, i32 addrspace(1)* %out
|
|
ret void
|
|
|
|
ENDIF:
|
|
br i1 %1, label %ENDLOOP, label %ENDIF
|
|
}
|
|
|
|
|
|
; FUNC-LABEL: {{^}}phi_cond_outside_loop:
|
|
; FIXME: This could be folded into the s_or_b64 instruction
|
|
; SI: s_mov_b64 [[ZERO:s\[[0-9]+:[0-9]+\]]], 0
|
|
; SI: [[LOOP_LABEL:[A-Z0-9]+]]
|
|
; SI: v_cmp_ne_i32_e32 vcc, 0, v{{[0-9]+}}
|
|
|
|
; SI_IF_BREAK instruction:
|
|
; SI: s_or_b64 [[BREAK:s\[[0-9]+:[0-9]+\]]], vcc, [[ZERO]]
|
|
|
|
; SI_LOOP instruction:
|
|
; SI: s_andn2_b64 exec, exec, [[BREAK]]
|
|
; SI: s_cbranch_execnz [[LOOP_LABEL]]
|
|
; SI: s_endpgm
|
|
|
|
define void @phi_cond_outside_loop(i32 %a, i32 %b) {
|
|
entry:
|
|
%0 = icmp eq i32 %a , 0
|
|
br i1 %0, label %if, label %else
|
|
|
|
if:
|
|
br label %endif
|
|
|
|
else:
|
|
%1 = icmp eq i32 %b, 0
|
|
br label %endif
|
|
|
|
endif:
|
|
%2 = phi i1 [0, %if], [%1, %else]
|
|
br label %loop
|
|
|
|
loop:
|
|
br i1 %2, label %exit, label %loop
|
|
|
|
exit:
|
|
ret void
|
|
}
|