[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / eliminate-frame-index-scalar-bit-ops.mir
blob1456bbc369b6ade4e0f5fe205fd8abf47ca8d7c0
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=MUBUFW64 %s
3 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=MUBUFW64 %s
4 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=MUBUFW64 %s
5 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=MUBUFW64 %s
6 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=MUBUFW32 %s
8 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx940 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=FLATSCRW64 %s
9 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=FLATSCRW32 %s
10 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -verify-machineinstrs -run-pass=prologepilog %s -o - | FileCheck -check-prefix=FLATSCRW32 %s
12 ---
13 name: s_or_b32__inline_imm__fi_offset0
14 tracksRegLiveness: true
15 stack:
16   - { id: 0, size: 32, alignment: 16 }
17 machineFunctionInfo:
18   scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
19   frameOffsetReg:  '$sgpr33'
20   stackPtrOffsetReg: '$sgpr32'
21 body:             |
22   bb.0:
23     ; MUBUFW64-LABEL: name: s_or_b32__inline_imm__fi_offset0
24     ; MUBUFW64: $sgpr4 = S_LSHR_B32 $sgpr32, 6, implicit-def dead $scc
25     ; MUBUFW64-NEXT: renamable $sgpr7 = S_OR_B32 12, killed $sgpr4, implicit-def $scc
26     ; MUBUFW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
27     ;
28     ; MUBUFW32-LABEL: name: s_or_b32__inline_imm__fi_offset0
29     ; MUBUFW32: $sgpr4 = S_LSHR_B32 $sgpr32, 5, implicit-def dead $scc
30     ; MUBUFW32-NEXT: renamable $sgpr7 = S_OR_B32 12, killed $sgpr4, implicit-def $scc
31     ; MUBUFW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
32     ;
33     ; FLATSCRW64-LABEL: name: s_or_b32__inline_imm__fi_offset0
34     ; FLATSCRW64: renamable $sgpr7 = S_OR_B32 12, $sgpr32, implicit-def $scc
35     ; FLATSCRW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
36     ;
37     ; FLATSCRW32-LABEL: name: s_or_b32__inline_imm__fi_offset0
38     ; FLATSCRW32: renamable $sgpr7 = S_OR_B32 12, $sgpr32, implicit-def $scc
39     ; FLATSCRW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
40     renamable $sgpr7 = S_OR_B32 12, %stack.0, implicit-def $scc
41     SI_RETURN implicit $sgpr7, implicit $scc
43 ...
45 ---
46 name: s_or_b32__literal__fi_offset96
47 tracksRegLiveness: true
48 stack:
49   - { id: 0, size: 96, alignment: 16 }
50   - { id: 1, size: 24, alignment: 4 }
51 machineFunctionInfo:
52   scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
53   frameOffsetReg:  '$sgpr33'
54   stackPtrOffsetReg: '$sgpr32'
55 body:             |
56   bb.0:
57     ; MUBUFW64-LABEL: name: s_or_b32__literal__fi_offset96
58     ; MUBUFW64: $sgpr4 = S_LSHR_B32 $sgpr32, 6, implicit-def $scc
59     ; MUBUFW64-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 96, implicit-def $scc
60     ; MUBUFW64-NEXT: renamable $sgpr7 = S_OR_B32 68, killed $sgpr4, implicit-def $scc
61     ; MUBUFW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
62     ;
63     ; MUBUFW32-LABEL: name: s_or_b32__literal__fi_offset96
64     ; MUBUFW32: $sgpr4 = S_LSHR_B32 $sgpr32, 5, implicit-def $scc
65     ; MUBUFW32-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 96, implicit-def $scc
66     ; MUBUFW32-NEXT: renamable $sgpr7 = S_OR_B32 68, killed $sgpr4, implicit-def $scc
67     ; MUBUFW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
68     ;
69     ; FLATSCRW64-LABEL: name: s_or_b32__literal__fi_offset96
70     ; FLATSCRW64: $sgpr4 = S_ADD_I32 $sgpr32, 96, implicit-def $scc
71     ; FLATSCRW64-NEXT: renamable $sgpr7 = S_OR_B32 68, killed $sgpr4, implicit-def $scc
72     ; FLATSCRW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
73     ;
74     ; FLATSCRW32-LABEL: name: s_or_b32__literal__fi_offset96
75     ; FLATSCRW32: $sgpr4 = S_ADD_I32 $sgpr32, 96, implicit-def $scc
76     ; FLATSCRW32-NEXT: renamable $sgpr7 = S_OR_B32 68, killed $sgpr4, implicit-def $scc
77     ; FLATSCRW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
78     renamable $sgpr7 = S_OR_B32 68, %stack.1, implicit-def $scc
79     SI_RETURN implicit $sgpr7, implicit $scc
81 ...
83 ---
84 name: s_or_b32__sgpr__fi_literal_offset
85 tracksRegLiveness: true
86 stack:
87   - { id: 0, size: 80, alignment: 16 }
88   - { id: 1, size: 48, alignment: 4 }
89 machineFunctionInfo:
90   scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
91   frameOffsetReg:  '$sgpr33'
92   stackPtrOffsetReg: '$sgpr32'
93 body:             |
94   bb.0:
95     liveins: $sgpr8
96     ; MUBUFW64-LABEL: name: s_or_b32__sgpr__fi_literal_offset
97     ; MUBUFW64: liveins: $sgpr8
98     ; MUBUFW64-NEXT: {{  $}}
99     ; MUBUFW64-NEXT: $sgpr4 = S_LSHR_B32 $sgpr32, 6, implicit-def $scc
100     ; MUBUFW64-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 80, implicit-def $scc
101     ; MUBUFW64-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
102     ; MUBUFW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
103     ;
104     ; MUBUFW32-LABEL: name: s_or_b32__sgpr__fi_literal_offset
105     ; MUBUFW32: liveins: $sgpr8
106     ; MUBUFW32-NEXT: {{  $}}
107     ; MUBUFW32-NEXT: $sgpr4 = S_LSHR_B32 $sgpr32, 5, implicit-def $scc
108     ; MUBUFW32-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 80, implicit-def $scc
109     ; MUBUFW32-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
110     ; MUBUFW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
111     ;
112     ; FLATSCRW64-LABEL: name: s_or_b32__sgpr__fi_literal_offset
113     ; FLATSCRW64: liveins: $sgpr8
114     ; FLATSCRW64-NEXT: {{  $}}
115     ; FLATSCRW64-NEXT: $sgpr4 = S_ADD_I32 $sgpr32, 80, implicit-def $scc
116     ; FLATSCRW64-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
117     ; FLATSCRW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
118     ;
119     ; FLATSCRW32-LABEL: name: s_or_b32__sgpr__fi_literal_offset
120     ; FLATSCRW32: liveins: $sgpr8
121     ; FLATSCRW32-NEXT: {{  $}}
122     ; FLATSCRW32-NEXT: $sgpr4 = S_ADD_I32 $sgpr32, 80, implicit-def $scc
123     ; FLATSCRW32-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
124     ; FLATSCRW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
125     renamable $sgpr7 = S_OR_B32 $sgpr8, %stack.1, implicit-def $scc
126     SI_RETURN implicit $sgpr7, implicit $scc
131 name: s_or_b32__sgpr__fi_inlineimm_offset
132 tracksRegLiveness: true
133 stack:
134   - { id: 0, size: 32, alignment: 16 }
135   - { id: 1, size: 48, alignment: 4 }
136 machineFunctionInfo:
137   scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
138   frameOffsetReg:  '$sgpr33'
139   stackPtrOffsetReg: '$sgpr32'
140 body:             |
141   bb.0:
142     liveins: $sgpr8
143     ; MUBUFW64-LABEL: name: s_or_b32__sgpr__fi_inlineimm_offset
144     ; MUBUFW64: liveins: $sgpr8
145     ; MUBUFW64-NEXT: {{  $}}
146     ; MUBUFW64-NEXT: $sgpr4 = S_LSHR_B32 $sgpr32, 6, implicit-def $scc
147     ; MUBUFW64-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 32, implicit-def $scc
148     ; MUBUFW64-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
149     ; MUBUFW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
150     ;
151     ; MUBUFW32-LABEL: name: s_or_b32__sgpr__fi_inlineimm_offset
152     ; MUBUFW32: liveins: $sgpr8
153     ; MUBUFW32-NEXT: {{  $}}
154     ; MUBUFW32-NEXT: $sgpr4 = S_LSHR_B32 $sgpr32, 5, implicit-def $scc
155     ; MUBUFW32-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 32, implicit-def $scc
156     ; MUBUFW32-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
157     ; MUBUFW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
158     ;
159     ; FLATSCRW64-LABEL: name: s_or_b32__sgpr__fi_inlineimm_offset
160     ; FLATSCRW64: liveins: $sgpr8
161     ; FLATSCRW64-NEXT: {{  $}}
162     ; FLATSCRW64-NEXT: $sgpr4 = S_ADD_I32 $sgpr32, 32, implicit-def $scc
163     ; FLATSCRW64-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
164     ; FLATSCRW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
165     ;
166     ; FLATSCRW32-LABEL: name: s_or_b32__sgpr__fi_inlineimm_offset
167     ; FLATSCRW32: liveins: $sgpr8
168     ; FLATSCRW32-NEXT: {{  $}}
169     ; FLATSCRW32-NEXT: $sgpr4 = S_ADD_I32 $sgpr32, 32, implicit-def $scc
170     ; FLATSCRW32-NEXT: renamable $sgpr7 = S_OR_B32 $sgpr8, killed $sgpr4, implicit-def $scc
171     ; FLATSCRW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
172     renamable $sgpr7 = S_OR_B32 $sgpr8, %stack.1, implicit-def $scc
173     SI_RETURN implicit $sgpr7, implicit $scc
178 name: s_and_b32__sgpr__fi_literal_offset
179 tracksRegLiveness: true
180 stack:
181   - { id: 0, size: 80, alignment: 16 }
182   - { id: 1, size: 48, alignment: 4 }
183 machineFunctionInfo:
184   scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
185   frameOffsetReg:  '$sgpr33'
186   stackPtrOffsetReg: '$sgpr32'
187 body:             |
188   bb.0:
189     liveins: $sgpr8
190     ; MUBUFW64-LABEL: name: s_and_b32__sgpr__fi_literal_offset
191     ; MUBUFW64: liveins: $sgpr8
192     ; MUBUFW64-NEXT: {{  $}}
193     ; MUBUFW64-NEXT: $sgpr4 = S_LSHR_B32 $sgpr32, 6, implicit-def $scc
194     ; MUBUFW64-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 80, implicit-def $scc
195     ; MUBUFW64-NEXT: renamable $sgpr7 = S_AND_B32 $sgpr8, killed $sgpr4, implicit-def $scc
196     ; MUBUFW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
197     ;
198     ; MUBUFW32-LABEL: name: s_and_b32__sgpr__fi_literal_offset
199     ; MUBUFW32: liveins: $sgpr8
200     ; MUBUFW32-NEXT: {{  $}}
201     ; MUBUFW32-NEXT: $sgpr4 = S_LSHR_B32 $sgpr32, 5, implicit-def $scc
202     ; MUBUFW32-NEXT: $sgpr4 = S_ADD_I32 killed $sgpr4, 80, implicit-def $scc
203     ; MUBUFW32-NEXT: renamable $sgpr7 = S_AND_B32 $sgpr8, killed $sgpr4, implicit-def $scc
204     ; MUBUFW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
205     ;
206     ; FLATSCRW64-LABEL: name: s_and_b32__sgpr__fi_literal_offset
207     ; FLATSCRW64: liveins: $sgpr8
208     ; FLATSCRW64-NEXT: {{  $}}
209     ; FLATSCRW64-NEXT: $sgpr4 = S_ADD_I32 $sgpr32, 80, implicit-def $scc
210     ; FLATSCRW64-NEXT: renamable $sgpr7 = S_AND_B32 $sgpr8, killed $sgpr4, implicit-def $scc
211     ; FLATSCRW64-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
212     ;
213     ; FLATSCRW32-LABEL: name: s_and_b32__sgpr__fi_literal_offset
214     ; FLATSCRW32: liveins: $sgpr8
215     ; FLATSCRW32-NEXT: {{  $}}
216     ; FLATSCRW32-NEXT: $sgpr4 = S_ADD_I32 $sgpr32, 80, implicit-def $scc
217     ; FLATSCRW32-NEXT: renamable $sgpr7 = S_AND_B32 $sgpr8, killed $sgpr4, implicit-def $scc
218     ; FLATSCRW32-NEXT: SI_RETURN implicit $sgpr7, implicit $scc
219     renamable $sgpr7 = S_AND_B32 $sgpr8, %stack.1, implicit-def $scc
220     SI_RETURN implicit $sgpr7, implicit $scc