1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -run-pass=prologepilog -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
4 # VGPR spill code in the prolog sets the `IsKill` flag for the spilled register
5 # based on the entry block's livein info.
8 name: vgpr_use_after_prolog_spill
9 tracksRegLiveness: true
11 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
12 frameOffsetReg: '$sgpr33'
13 stackPtrOffsetReg: '$sgpr32'
16 liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
18 ; GCN-LABEL: name: vgpr_use_after_prolog_spill
19 ; GCN: liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
21 ; GCN-NEXT: $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr0, implicit $exec
22 ; GCN-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
23 ; GCN-NEXT: S_NOP 0, implicit-def $vgpr0
24 ; GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31
25 $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr0, implicit $exec
26 $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
27 S_NOP 0, implicit-def $vgpr0
28 S_SETPC_B64_return $sgpr30_sgpr31
32 name: livein_vgpr_def_after_prolog_spill
33 tracksRegLiveness: true
35 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
36 frameOffsetReg: '$sgpr33'
37 stackPtrOffsetReg: '$sgpr32'
40 liveins: $sgpr42, $vgpr0, $vgpr1, $sgpr30_sgpr31
42 ; GCN-LABEL: name: livein_vgpr_def_after_prolog_spill
43 ; GCN: liveins: $sgpr42, $vgpr0, $vgpr1, $sgpr30_sgpr31
45 ; GCN-NEXT: $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr1, implicit $exec
46 ; GCN-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
47 ; GCN-NEXT: S_NOP 0, implicit-def $vgpr0
48 ; GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31
49 $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr1, implicit $exec
50 $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
51 S_NOP 0, implicit-def $vgpr0
52 S_SETPC_B64_return $sgpr30_sgpr31
56 name: livein_vgpr_not_referred_in_entry_bb
57 tracksRegLiveness: true
59 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
60 frameOffsetReg: '$sgpr33'
61 stackPtrOffsetReg: '$sgpr32'
63 ; GCN-LABEL: name: livein_vgpr_not_referred_in_entry_bb
65 ; GCN-NEXT: successors: %bb.1(0x80000000)
66 ; GCN-NEXT: liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
69 ; GCN-NEXT: S_BRANCH %bb.1
72 ; GCN-NEXT: liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
74 ; GCN-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
75 ; GCN-NEXT: S_NOP 0, implicit-def $vgpr0
76 ; GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31
78 liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
82 liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
83 $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
84 S_NOP 0, implicit-def $vgpr0
85 S_SETPC_B64_return $sgpr30_sgpr31