1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -verify-machineinstrs -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=regallocfast -o - %s | FileCheck %s
4 # Make sure incorrect kills aren't emitted on vcc
8 tracksRegLiveness: true
11 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
12 stackPtrOffsetReg: '$sgpr32'
17 ; CHECK-LABEL: name: foo
18 ; CHECK: liveins: $vgpr0
20 ; CHECK-NEXT: V_CMP_NE_U32_e32 0, killed $vgpr0, implicit-def $vcc, implicit $exec
21 ; CHECK-NEXT: $sgpr4_sgpr5 = COPY $vcc
22 ; CHECK-NEXT: renamable $vgpr0 = V_CNDMASK_B32_e64 0, -1, 0, 3, killed $vcc, implicit $exec
23 ; CHECK-NEXT: S_ENDPGM 0, implicit killed $vgpr0, implicit killed $sgpr4_sgpr5
24 %0:vgpr_32 = COPY $vgpr0
25 V_CMP_NE_U32_e32 0, %0, implicit-def $vcc, implicit $exec
26 $sgpr4_sgpr5 = COPY $vcc
27 %1:sreg_64_xexec = COPY $vcc
28 %2:vgpr_32 = V_CNDMASK_B32_e64 0, -1, 0, 3, %1, implicit $exec
30 S_ENDPGM 0, implicit $vgpr0, implicit $sgpr4_sgpr5
34 # This would hit "Unexpected reg unit state" assert.
37 tracksRegLiveness: true
40 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
41 stackPtrOffsetReg: '$sgpr32'
46 ; CHECK-LABEL: name: bar
47 ; CHECK: liveins: $vgpr0
49 ; CHECK-NEXT: V_CMP_NE_U32_e32 0, killed $vgpr0, implicit-def $vcc, implicit $exec
50 ; CHECK-NEXT: renamable $sgpr4_sgpr5 = COPY $vcc
51 ; CHECK-NEXT: SI_SPILL_S64_SAVE $sgpr4_sgpr5, %stack.0, implicit $exec, implicit $sgpr32 :: (store (s64) into %stack.0, align 4, addrspace 5)
52 ; CHECK-NEXT: renamable $sgpr4_sgpr5 = COPY $vcc
53 ; CHECK-NEXT: $vcc = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sgpr32 :: (load (s64) from %stack.0, align 4, addrspace 5)
54 ; CHECK-NEXT: renamable $vgpr0 = V_CNDMASK_B32_e64 0, -1, 0, 3, killed $sgpr4_sgpr5, implicit $exec
55 ; CHECK-NEXT: S_ENDPGM 0, implicit killed $vgpr0, implicit killed renamable $vcc
56 %0:vgpr_32 = COPY $vgpr0
57 V_CMP_NE_U32_e32 0, %0, implicit-def $vcc, implicit $exec
58 %3:sreg_64_xexec = COPY $vcc
59 %1:sreg_64_xexec = COPY $vcc
60 %2:vgpr_32 = V_CNDMASK_B32_e64 0, -1, 0, 3, %1, implicit $exec
62 S_ENDPGM 0, implicit $vgpr0, implicit %3