1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -verify-machineinstrs -run-pass=si-optimize-exec-masking -o - %s | FileCheck %s
4 # Make sure we can still optimize writes to exec when there are
5 # additional terminators after the exec write. This can happen with
6 # phi users of control flow intrinsics.
9 name: instructions_after_copy_to_exec
10 tracksRegLiveness: true
12 ; CHECK-LABEL: name: instructions_after_copy_to_exec
14 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
15 ; CHECK-NEXT: liveins: $vgpr0
17 ; CHECK-NEXT: renamable $vgpr1 = V_MOV_B32_e32 0, implicit $exec
18 ; CHECK-NEXT: renamable $vcc = V_CMP_EQ_U32_e64 0, killed $vgpr0, implicit $exec
19 ; CHECK-NEXT: $sgpr0_sgpr1 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
20 ; CHECK-NEXT: renamable $sgpr0_sgpr1 = S_XOR_B64 $exec, killed renamable $sgpr0_sgpr1, implicit-def dead $scc
21 ; CHECK-NEXT: renamable $sgpr0_sgpr1 = COPY killed renamable $sgpr0_sgpr1, implicit $exec
22 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
25 ; CHECK-NEXT: successors: %bb.2(0x80000000)
26 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
28 ; CHECK-NEXT: S_NOP 0, implicit $sgpr0_sgpr1
31 ; CHECK-NEXT: liveins: $sgpr0_sgpr1
33 ; CHECK-NEXT: S_NOP 0, implicit $sgpr0_sgpr1
37 renamable $vgpr1 = V_MOV_B32_e32 0, implicit $exec
38 renamable $vcc = V_CMP_EQ_U32_e64 0, killed $vgpr0, implicit $exec
39 renamable $sgpr0_sgpr1 = COPY $exec, implicit-def $exec
40 renamable $sgpr2_sgpr3 = S_AND_B64 renamable $sgpr0_sgpr1, renamable $vcc, implicit-def dead $scc
41 renamable $sgpr0_sgpr1 = S_XOR_B64 renamable $sgpr2_sgpr3, killed renamable $sgpr0_sgpr1, implicit-def dead $scc
42 $exec = S_MOV_B64_term killed renamable $sgpr2_sgpr3
43 renamable $sgpr0_sgpr1 = S_MOV_B64_term killed renamable $sgpr0_sgpr1, implicit $exec
44 S_CBRANCH_EXECZ %bb.2, implicit $exec
49 S_NOP 0, implicit $sgpr0_sgpr1
54 S_NOP 0, implicit $sgpr0_sgpr1