1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefixes=CHECK,GFX9 %s
3# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefixes=CHECK,GFX10 %s
4
5--- |
6  define amdgpu_kernel void @check_vcc() #0 {
7    ret void
8  }
9
10  attributes #0 = {  "frame-pointer"="all" }
11...
12---
13name:            check_vcc
14tracksRegLiveness: true
15liveins:
16  - { reg: '$sgpr4_sgpr5' }
17  - { reg: '$sgpr6_sgpr7' }
18  - { reg: '$sgpr8' }
19frameInfo:
20  maxAlignment:    4
21stack:
22  - { id: 0, type: spill-slot, size: 8, alignment: 4 }
23machineFunctionInfo:
24  isEntryFunction: true
25  waveLimiter:     true
26  scratchRSrcReg:  '$sgpr96_sgpr97_sgpr98_sgpr99'
27  stackPtrOffsetReg: '$sgpr32'
28  frameOffsetReg: '$sgpr33'
29  argumentInfo:
30    privateSegmentBuffer: { reg: '$sgpr0_sgpr1_sgpr2_sgpr3' }
31    dispatchPtr:     { reg: '$sgpr4_sgpr5' }
32    kernargSegmentPtr: { reg: '$sgpr6_sgpr7' }
33    workGroupIDX:    { reg: '$sgpr8' }
34    privateSegmentWaveByteOffset: { reg: '$sgpr9' }
35body:             |
36  bb.0:
37    liveins: $sgpr8, $sgpr4_sgpr5, $sgpr6_sgpr7
38
39    ; GFX9-LABEL: name: check_vcc
40    ; GFX9: liveins: $sgpr8, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr9
41    ; GFX9: $sgpr33 = S_MOV_B32 0
42    ; GFX9: $sgpr12 = S_MOV_B32 &SCRATCH_RSRC_DWORD0, implicit-def $sgpr12_sgpr13_sgpr14_sgpr15
43    ; GFX9: $sgpr13 = S_MOV_B32 &SCRATCH_RSRC_DWORD1, implicit-def $sgpr12_sgpr13_sgpr14_sgpr15
44    ; GFX9: $sgpr14 = S_MOV_B32 4294967295, implicit-def $sgpr12_sgpr13_sgpr14_sgpr15
45    ; GFX9: $sgpr15 = S_MOV_B32 14680064, implicit-def $sgpr12_sgpr13_sgpr14_sgpr15
46    ; GFX9: $sgpr12 = S_ADD_U32 $sgpr12, $sgpr9, implicit-def $scc, implicit-def $sgpr12_sgpr13_sgpr14_sgpr15
47    ; GFX9: $sgpr13 = S_ADDC_U32 $sgpr13, 0, implicit-def $scc, implicit $scc, implicit-def $sgpr12_sgpr13_sgpr14_sgpr15
48    ; GFX9: $vcc = IMPLICIT_DEF
49    ; GFX9: $vgpr0 = V_WRITELANE_B32 $vcc_lo, 0, undef $vgpr0, implicit $vcc
50    ; GFX9: $vgpr0 = V_WRITELANE_B32 $vcc_hi, 1, $vgpr0, implicit $vcc
51    ; GFX9: $vcc = S_MOV_B64 $exec
52    ; GFX9: $exec = S_MOV_B64 3
53    ; GFX9: BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr12_sgpr13_sgpr14_sgpr15, $sgpr33, 4, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
54    ; GFX9: $exec = S_MOV_B64 $vcc
55    ; GFX9: $vcc_hi = V_READLANE_B32 $vgpr0, 1
56    ; GFX9: $vcc_lo = V_READLANE_B32 killed $vgpr0, 0
57    ; GFX9: $vcc = IMPLICIT_DEF
58    ; GFX9: $vgpr0 = V_WRITELANE_B32 $vcc_lo, 0, undef $vgpr0, implicit $vcc
59    ; GFX9: $vgpr0 = V_WRITELANE_B32 $vcc_hi, 1, $vgpr0, implicit killed $vcc
60    ; GFX9: $vcc = S_MOV_B64 $exec
61    ; GFX9: $exec = S_MOV_B64 3
62    ; GFX9: BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr12_sgpr13_sgpr14_sgpr15, $sgpr33, 4, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
63    ; GFX9: $exec = S_MOV_B64 killed $vcc
64    ; GFX9: $vcc = S_MOV_B64 $exec
65    ; GFX9: $exec = S_MOV_B64 3
66    ; GFX9: $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr12_sgpr13_sgpr14_sgpr15, $sgpr33, 4, 0, 0, 0, 0, 0, implicit $exec :: (load 4 from %stack.0, addrspace 5)
67    ; GFX9: $exec = S_MOV_B64 killed $vcc
68    ; GFX9: $vcc_lo = V_READLANE_B32 $vgpr0, 0, implicit-def $vcc
69    ; GFX9: $vcc_hi = V_READLANE_B32 killed $vgpr0, 1
70    ; GFX10-LABEL: name: check_vcc
71    ; GFX10: liveins: $sgpr8, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr9
72    ; GFX10: $sgpr33 = S_MOV_B32 0
73    ; GFX10: $sgpr96 = S_MOV_B32 &SCRATCH_RSRC_DWORD0, implicit-def $sgpr96_sgpr97_sgpr98_sgpr99
74    ; GFX10: $sgpr97 = S_MOV_B32 &SCRATCH_RSRC_DWORD1, implicit-def $sgpr96_sgpr97_sgpr98_sgpr99
75    ; GFX10: $sgpr98 = S_MOV_B32 4294967295, implicit-def $sgpr96_sgpr97_sgpr98_sgpr99
76    ; GFX10: $sgpr99 = S_MOV_B32 836853760, implicit-def $sgpr96_sgpr97_sgpr98_sgpr99
77    ; GFX10: $sgpr96 = S_ADD_U32 $sgpr96, $sgpr9, implicit-def $scc, implicit-def $sgpr96_sgpr97_sgpr98_sgpr99
78    ; GFX10: $sgpr97 = S_ADDC_U32 $sgpr97, 0, implicit-def $scc, implicit $scc, implicit-def $sgpr96_sgpr97_sgpr98_sgpr99
79    ; GFX10: $vcc = IMPLICIT_DEF
80    ; GFX10: $vgpr0 = V_WRITELANE_B32 $vcc_lo, 0, undef $vgpr0, implicit $vcc
81    ; GFX10: $vgpr0 = V_WRITELANE_B32 $vcc_hi, 1, $vgpr0, implicit $vcc
82    ; GFX10: $vcc = S_MOV_B64 $exec
83    ; GFX10: $exec = S_MOV_B64 3
84    ; GFX10: BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr96_sgpr97_sgpr98_sgpr99, $sgpr33, 4, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
85    ; GFX10: $exec = S_MOV_B64 $vcc
86    ; GFX10: $vcc_hi = V_READLANE_B32 $vgpr0, 1
87    ; GFX10: $vcc_lo = V_READLANE_B32 killed $vgpr0, 0
88    ; GFX10: $vcc = IMPLICIT_DEF
89    ; GFX10: $vgpr0 = V_WRITELANE_B32 $vcc_lo, 0, undef $vgpr0, implicit $vcc
90    ; GFX10: $vgpr0 = V_WRITELANE_B32 $vcc_hi, 1, $vgpr0, implicit killed $vcc
91    ; GFX10: $vcc = S_MOV_B64 $exec
92    ; GFX10: $exec = S_MOV_B64 3
93    ; GFX10: BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr96_sgpr97_sgpr98_sgpr99, $sgpr33, 4, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %stack.0, addrspace 5)
94    ; GFX10: $exec = S_MOV_B64 killed $vcc
95    ; GFX10: $vcc = S_MOV_B64 $exec
96    ; GFX10: $exec = S_MOV_B64 3
97    ; GFX10: $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr96_sgpr97_sgpr98_sgpr99, $sgpr33, 4, 0, 0, 0, 0, 0, implicit $exec :: (load 4 from %stack.0, addrspace 5)
98    ; GFX10: $exec = S_MOV_B64 killed $vcc
99    ; GFX10: $vcc_lo = V_READLANE_B32 $vgpr0, 0, implicit-def $vcc
100    ; GFX10: $vcc_hi = V_READLANE_B32 killed $vgpr0, 1
101    $vcc = IMPLICIT_DEF
102    SI_SPILL_S64_SAVE $vcc, %stack.0, implicit $exec, implicit $sgpr96_sgpr97_sgpr98_sgpr99, implicit $sgpr32
103
104    $vcc = IMPLICIT_DEF
105    SI_SPILL_S64_SAVE killed $vcc, %stack.0, implicit $exec, implicit $sgpr96_sgpr97_sgpr98_sgpr99, implicit $sgpr32
106
107    $vcc = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sgpr96_sgpr97_sgpr98_sgpr99, implicit $sgpr32
108...
109