1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=si-lower-control-flow -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN %s
4 # Check that assert is not triggered
8 name: si-lower-control-flow
11 ; GCN-LABEL: name: si-lower-control-flow
12 ; GCN: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
13 ; GCN: [[S_LOAD_DWORD_IMM:%[0-9]+]]:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM [[COPY]], 16, 0
14 ; GCN: [[S_AND_B32_:%[0-9]+]]:sreg_32_xm0 = S_AND_B32 [[S_LOAD_DWORD_IMM]], 255, implicit-def $scc
15 ; GCN: [[S_AND_B32_1:%[0-9]+]]:sreg_32_xm0 = S_AND_B32 65535, [[S_AND_B32_]], implicit-def $scc
17 %0:sgpr_64 = COPY $sgpr4_sgpr5
18 %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 16, 0, 0
19 %2:sreg_32_xm0 = S_AND_B32 %1, 255, implicit-def $scc
20 %3:sreg_32_xm0 = S_AND_B32 65535, %2, implicit-def $scc
25 name: preserve_undef_flag_si_if_src
26 tracksRegLiveness: true
28 ; GCN-LABEL: name: preserve_undef_flag_si_if_src
30 ; GCN: successors: %bb.1(0x40000000), %bb.2(0x40000000)
31 ; GCN: [[COPY:%[0-9]+]]:sreg_64 = COPY $exec, implicit-def $exec
32 ; GCN: [[S_AND_B64_:%[0-9]+]]:sreg_64 = S_AND_B64 [[COPY]], undef %1:sreg_64, implicit-def dead $scc
33 ; GCN: [[S_XOR_B64_:%[0-9]+]]:sreg_64 = S_XOR_B64 [[S_AND_B64_]], [[COPY]], implicit-def dead $scc
34 ; GCN: $exec = S_MOV_B64_term killed [[S_AND_B64_]]
35 ; GCN: SI_MASK_BRANCH %bb.2, implicit $exec
38 ; GCN: successors: %bb.2(0x80000000)
42 successors: %bb.1, %bb.2
44 %1:sreg_64 = SI_IF undef %0:sreg_64, %bb.2, implicit-def dead $exec, implicit-def dead $scc, implicit $exec