1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=CHECK -check-prefix=GCN64 %s
3
4---
5name: spill_v32
6tracksRegLiveness: true
7stack:
8  - { id: 0, type: spill-slot, size: 4, alignment: 4 }
9machineFunctionInfo:
10  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
11  stackPtrOffsetReg: '$sgpr32'
12  frameOffsetReg: '$sgpr33'
13body:             |
14  bb.0:
15    liveins: $vgpr0
16
17    ; CHECK-LABEL: name: spill_v32
18    ; CHECK: liveins: $vgpr0
19    ; CHECK: BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
20    ; CHECK: S_NOP 0, implicit $vgpr0
21    SI_SPILL_V32_SAVE $vgpr0, %stack.0, $sgpr32, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
22    S_NOP 0, implicit $vgpr0
23...
24
25---
26name: spill_v32_kill
27tracksRegLiveness: true
28stack:
29  - { id: 0, type: spill-slot, size: 4, alignment: 4 }
30machineFunctionInfo:
31  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
32  stackPtrOffsetReg: '$sgpr32'
33  frameOffsetReg: '$sgpr33'
34body:             |
35  bb.0:
36    liveins: $vgpr0
37
38    ; CHECK-LABEL: name: spill_v32_kill
39    ; CHECK: liveins: $vgpr0
40    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
41    SI_SPILL_V32_SAVE killed $vgpr0, %stack.0, $sgpr32, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
42...
43
44---
45name: spill_v64
46tracksRegLiveness: true
47stack:
48  - { id: 0, type: spill-slot, size: 8, alignment: 4 }
49machineFunctionInfo:
50  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
51  stackPtrOffsetReg: '$sgpr32'
52  frameOffsetReg: '$sgpr33'
53body:             |
54  bb.0:
55    liveins: $vgpr0_vgpr1
56
57    ; CHECK-LABEL: name: spill_v64
58    ; CHECK: liveins: $vgpr0_vgpr1
59    ; CHECK: BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $vgpr0_vgpr1 :: (store 4 into %stack.0, addrspace 5)
60    ; CHECK: BUFFER_STORE_DWORD_OFFSET $vgpr1, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 4, 0, 0, 0, 0, 0, implicit $exec, implicit $vgpr0_vgpr1 :: (store 4 into %stack.0 + 4, addrspace 5)
61    ; CHECK: S_NOP 0, implicit $vgpr0_vgpr1
62    SI_SPILL_V64_SAVE $vgpr0_vgpr1, %stack.0, $sgpr32, 0, implicit $exec :: (store 8 into %stack.0, addrspace 5)
63    S_NOP 0, implicit $vgpr0_vgpr1
64...
65
66---
67name: spill_v64_kill
68tracksRegLiveness: true
69stack:
70  - { id: 0, type: spill-slot, size: 8, alignment: 4 }
71machineFunctionInfo:
72  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
73  stackPtrOffsetReg: '$sgpr32'
74  frameOffsetReg: '$sgpr33'
75body:             |
76  bb.0:
77    liveins: $vgpr0_vgpr1
78
79    ; CHECK-LABEL: name: spill_v64_kill
80    ; CHECK: liveins: $vgpr0_vgpr1
81    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $vgpr0_vgpr1 :: (store 4 into %stack.0, addrspace 5)
82    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr1, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 4, 0, 0, 0, 0, 0, implicit $exec, implicit killed $vgpr0_vgpr1 :: (store 4 into %stack.0 + 4, addrspace 5)
83    SI_SPILL_V64_SAVE killed $vgpr0_vgpr1, %stack.0, $sgpr32, 0, implicit $exec :: (store 8 into %stack.0, addrspace 5)
84...
85
86# Make sure there's no verifier error on the undef spill component when the value is killed.
87
88---
89name: spill_v64_undef_sub1_killed
90tracksRegLiveness: true
91stack:
92  - { id: 0, type: spill-slot, size: 8, alignment: 4 }
93machineFunctionInfo:
94  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
95  stackPtrOffsetReg: '$sgpr32'
96  frameOffsetReg: '$sgpr33'
97body:             |
98  bb.0:
99    liveins: $vgpr0
100
101    ; CHECK-LABEL: name: spill_v64_undef_sub1_killed
102    ; CHECK: liveins: $vgpr0
103    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $vgpr0_vgpr1 :: (store 4 into %stack.0, addrspace 5)
104    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr1, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 4, 0, 0, 0, 0, 0, implicit $exec, implicit killed $vgpr0_vgpr1 :: (store 4 into %stack.0 + 4, addrspace 5)
105    SI_SPILL_V64_SAVE killed $vgpr0_vgpr1, %stack.0, $sgpr32, 0, implicit $exec :: (store 8 into %stack.0, addrspace 5)
106...
107
108---
109name: spill_v64_undef_sub0_killed
110tracksRegLiveness: true
111stack:
112  - { id: 0, type: spill-slot, size: 8, alignment: 4 }
113machineFunctionInfo:
114  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
115  stackPtrOffsetReg: '$sgpr32'
116  frameOffsetReg: '$sgpr33'
117body:             |
118  bb.0:
119    liveins: $vgpr1
120
121    ; CHECK-LABEL: name: spill_v64_undef_sub0_killed
122    ; CHECK: liveins: $vgpr1
123    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, 0, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $vgpr0_vgpr1 :: (store 4 into %stack.0, addrspace 5)
124    ; CHECK: BUFFER_STORE_DWORD_OFFSET killed $vgpr1, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 4, 0, 0, 0, 0, 0, implicit $exec, implicit killed $vgpr0_vgpr1 :: (store 4 into %stack.0 + 4, addrspace 5)
125    SI_SPILL_V64_SAVE killed $vgpr0_vgpr1, %stack.0, $sgpr32, 0, implicit $exec :: (store 8 into %stack.0, addrspace 5)
126...
127