35#define DEBUG_TYPE "arm-pseudo"
37#define ARM_EXPAND_PSEUDO_NAME "ARM pseudo instruction expansion pass"
74 unsigned Opc,
bool IsExt);
114 unsigned StrexOp,
unsigned UxtOp,
121 char ARMExpandPseudo::ID = 0;
132 enum NEONRegSpacing {
143 struct NEONLdStTableEntry {
148 bool hasWritebackOperand;
157 bool copyAllListRegs;
160 bool operator<(
const NEONLdStTableEntry &TE)
const {
161 return PseudoOpc < TE.PseudoOpc;
163 friend bool operator<(
const NEONLdStTableEntry &TE,
unsigned PseudoOpc) {
164 return TE.PseudoOpc < PseudoOpc;
166 [[maybe_unused]]
friend bool operator<(
unsigned PseudoOpc,
167 const NEONLdStTableEntry &TE) {
168 return PseudoOpc < TE.PseudoOpc;
174{ ARM::VLD1LNq16Pseudo, ARM::VLD1LNd16,
true,
false,
false, EvenDblSpc, 1, 4 ,
true},
175{ ARM::VLD1LNq16Pseudo_UPD, ARM::VLD1LNd16_UPD,
true,
true,
true, EvenDblSpc, 1, 4 ,
true},
176{ ARM::VLD1LNq32Pseudo, ARM::VLD1LNd32,
true,
false,
false, EvenDblSpc, 1, 2 ,
true},
177{ ARM::VLD1LNq32Pseudo_UPD, ARM::VLD1LNd32_UPD,
true,
true,
true, EvenDblSpc, 1, 2 ,
true},
178{ ARM::VLD1LNq8Pseudo, ARM::VLD1LNd8,
true,
false,
false, EvenDblSpc, 1, 8 ,
true},
179{ ARM::VLD1LNq8Pseudo_UPD, ARM::VLD1LNd8_UPD,
true,
true,
true, EvenDblSpc, 1, 8 ,
true},
181{ ARM::VLD1d16QPseudo, ARM::VLD1d16Q,
true,
false,
false, SingleSpc, 4, 4 ,
false},
182{ ARM::VLD1d16QPseudoWB_fixed, ARM::VLD1d16Qwb_fixed,
true,
true,
false, SingleSpc, 4, 4 ,
false},
183{ ARM::VLD1d16QPseudoWB_register, ARM::VLD1d16Qwb_register,
true,
true,
true, SingleSpc, 4, 4 ,
false},
184{ ARM::VLD1d16TPseudo, ARM::VLD1d16T,
true,
false,
false, SingleSpc, 3, 4 ,
false},
185{ ARM::VLD1d16TPseudoWB_fixed, ARM::VLD1d16Twb_fixed,
true,
true,
false, SingleSpc, 3, 4 ,
false},
186{ ARM::VLD1d16TPseudoWB_register, ARM::VLD1d16Twb_register,
true,
true,
true, SingleSpc, 3, 4 ,
false},
188{ ARM::VLD1d32QPseudo, ARM::VLD1d32Q,
true,
false,
false, SingleSpc, 4, 2 ,
false},
189{ ARM::VLD1d32QPseudoWB_fixed, ARM::VLD1d32Qwb_fixed,
true,
true,
false, SingleSpc, 4, 2 ,
false},
190{ ARM::VLD1d32QPseudoWB_register, ARM::VLD1d32Qwb_register,
true,
true,
true, SingleSpc, 4, 2 ,
false},
191{ ARM::VLD1d32TPseudo, ARM::VLD1d32T,
true,
false,
false, SingleSpc, 3, 2 ,
false},
192{ ARM::VLD1d32TPseudoWB_fixed, ARM::VLD1d32Twb_fixed,
true,
true,
false, SingleSpc, 3, 2 ,
false},
193{ ARM::VLD1d32TPseudoWB_register, ARM::VLD1d32Twb_register,
true,
true,
true, SingleSpc, 3, 2 ,
false},
195{ ARM::VLD1d64QPseudo, ARM::VLD1d64Q,
true,
false,
false, SingleSpc, 4, 1 ,
false},
196{ ARM::VLD1d64QPseudoWB_fixed, ARM::VLD1d64Qwb_fixed,
true,
true,
false, SingleSpc, 4, 1 ,
false},
197{ ARM::VLD1d64QPseudoWB_register, ARM::VLD1d64Qwb_register,
true,
true,
true, SingleSpc, 4, 1 ,
false},
198{ ARM::VLD1d64TPseudo, ARM::VLD1d64T,
true,
false,
false, SingleSpc, 3, 1 ,
false},
199{ ARM::VLD1d64TPseudoWB_fixed, ARM::VLD1d64Twb_fixed,
true,
true,
false, SingleSpc, 3, 1 ,
false},
200{ ARM::VLD1d64TPseudoWB_register, ARM::VLD1d64Twb_register,
true,
true,
true, SingleSpc, 3, 1 ,
false},
202{ ARM::VLD1d8QPseudo, ARM::VLD1d8Q,
true,
false,
false, SingleSpc, 4, 8 ,
false},
203{ ARM::VLD1d8QPseudoWB_fixed, ARM::VLD1d8Qwb_fixed,
true,
true,
false, SingleSpc, 4, 8 ,
false},
204{ ARM::VLD1d8QPseudoWB_register, ARM::VLD1d8Qwb_register,
true,
true,
true, SingleSpc, 4, 8 ,
false},
205{ ARM::VLD1d8TPseudo, ARM::VLD1d8T,
true,
false,
false, SingleSpc, 3, 8 ,
false},
206{ ARM::VLD1d8TPseudoWB_fixed, ARM::VLD1d8Twb_fixed,
true,
true,
false, SingleSpc, 3, 8 ,
false},
207{ ARM::VLD1d8TPseudoWB_register, ARM::VLD1d8Twb_register,
true,
true,
true, SingleSpc, 3, 8 ,
false},
209{ ARM::VLD1q16HighQPseudo, ARM::VLD1d16Q,
true,
false,
false, SingleHighQSpc, 4, 4 ,
false},
210{ ARM::VLD1q16HighQPseudo_UPD, ARM::VLD1d16Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 4 ,
false},
211{ ARM::VLD1q16HighTPseudo, ARM::VLD1d16T,
true,
false,
false, SingleHighTSpc, 3, 4 ,
false},
212{ ARM::VLD1q16HighTPseudo_UPD, ARM::VLD1d16Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 4 ,
false},
213{ ARM::VLD1q16LowQPseudo_UPD, ARM::VLD1d16Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 4 ,
false},
214{ ARM::VLD1q16LowTPseudo_UPD, ARM::VLD1d16Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 4 ,
false},
216{ ARM::VLD1q32HighQPseudo, ARM::VLD1d32Q,
true,
false,
false, SingleHighQSpc, 4, 2 ,
false},
217{ ARM::VLD1q32HighQPseudo_UPD, ARM::VLD1d32Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 2 ,
false},
218{ ARM::VLD1q32HighTPseudo, ARM::VLD1d32T,
true,
false,
false, SingleHighTSpc, 3, 2 ,
false},
219{ ARM::VLD1q32HighTPseudo_UPD, ARM::VLD1d32Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 2 ,
false},
220{ ARM::VLD1q32LowQPseudo_UPD, ARM::VLD1d32Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 2 ,
false},
221{ ARM::VLD1q32LowTPseudo_UPD, ARM::VLD1d32Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 2 ,
false},
223{ ARM::VLD1q64HighQPseudo, ARM::VLD1d64Q,
true,
false,
false, SingleHighQSpc, 4, 1 ,
false},
224{ ARM::VLD1q64HighQPseudo_UPD, ARM::VLD1d64Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 1 ,
false},
225{ ARM::VLD1q64HighTPseudo, ARM::VLD1d64T,
true,
false,
false, SingleHighTSpc, 3, 1 ,
false},
226{ ARM::VLD1q64HighTPseudo_UPD, ARM::VLD1d64Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 1 ,
false},
227{ ARM::VLD1q64LowQPseudo_UPD, ARM::VLD1d64Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 1 ,
false},
228{ ARM::VLD1q64LowTPseudo_UPD, ARM::VLD1d64Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 1 ,
false},
230{ ARM::VLD1q8HighQPseudo, ARM::VLD1d8Q,
true,
false,
false, SingleHighQSpc, 4, 8 ,
false},
231{ ARM::VLD1q8HighQPseudo_UPD, ARM::VLD1d8Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 8 ,
false},
232{ ARM::VLD1q8HighTPseudo, ARM::VLD1d8T,
true,
false,
false, SingleHighTSpc, 3, 8 ,
false},
233{ ARM::VLD1q8HighTPseudo_UPD, ARM::VLD1d8Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 8 ,
false},
234{ ARM::VLD1q8LowQPseudo_UPD, ARM::VLD1d8Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 8 ,
false},
235{ ARM::VLD1q8LowTPseudo_UPD, ARM::VLD1d8Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 8 ,
false},
237{ ARM::VLD2DUPq16EvenPseudo, ARM::VLD2DUPd16x2,
true,
false,
false, EvenDblSpc, 2, 4 ,
false},
238{ ARM::VLD2DUPq16OddPseudo, ARM::VLD2DUPd16x2,
true,
false,
false, OddDblSpc, 2, 4 ,
false},
239{ ARM::VLD2DUPq16OddPseudoWB_fixed, ARM::VLD2DUPd16x2wb_fixed,
true,
true,
false, OddDblSpc, 2, 4 ,
false},
240{ ARM::VLD2DUPq16OddPseudoWB_register, ARM::VLD2DUPd16x2wb_register,
true,
true,
true, OddDblSpc, 2, 4 ,
false},
241{ ARM::VLD2DUPq32EvenPseudo, ARM::VLD2DUPd32x2,
true,
false,
false, EvenDblSpc, 2, 2 ,
false},
242{ ARM::VLD2DUPq32OddPseudo, ARM::VLD2DUPd32x2,
true,
false,
false, OddDblSpc, 2, 2 ,
false},
243{ ARM::VLD2DUPq32OddPseudoWB_fixed, ARM::VLD2DUPd32x2wb_fixed,
true,
true,
false, OddDblSpc, 2, 2 ,
false},
244{ ARM::VLD2DUPq32OddPseudoWB_register, ARM::VLD2DUPd32x2wb_register,
true,
true,
true, OddDblSpc, 2, 2 ,
false},
245{ ARM::VLD2DUPq8EvenPseudo, ARM::VLD2DUPd8x2,
true,
false,
false, EvenDblSpc, 2, 8 ,
false},
246{ ARM::VLD2DUPq8OddPseudo, ARM::VLD2DUPd8x2,
true,
false,
false, OddDblSpc, 2, 8 ,
false},
247{ ARM::VLD2DUPq8OddPseudoWB_fixed, ARM::VLD2DUPd8x2wb_fixed,
true,
true,
false, OddDblSpc, 2, 8 ,
false},
248{ ARM::VLD2DUPq8OddPseudoWB_register, ARM::VLD2DUPd8x2wb_register,
true,
true,
true, OddDblSpc, 2, 8 ,
false},
250{ ARM::VLD2LNd16Pseudo, ARM::VLD2LNd16,
true,
false,
false, SingleSpc, 2, 4 ,
true},
251{ ARM::VLD2LNd16Pseudo_UPD, ARM::VLD2LNd16_UPD,
true,
true,
true, SingleSpc, 2, 4 ,
true},
252{ ARM::VLD2LNd32Pseudo, ARM::VLD2LNd32,
true,
false,
false, SingleSpc, 2, 2 ,
true},
253{ ARM::VLD2LNd32Pseudo_UPD, ARM::VLD2LNd32_UPD,
true,
true,
true, SingleSpc, 2, 2 ,
true},
254{ ARM::VLD2LNd8Pseudo, ARM::VLD2LNd8,
true,
false,
false, SingleSpc, 2, 8 ,
true},
255{ ARM::VLD2LNd8Pseudo_UPD, ARM::VLD2LNd8_UPD,
true,
true,
true, SingleSpc, 2, 8 ,
true},
256{ ARM::VLD2LNq16Pseudo, ARM::VLD2LNq16,
true,
false,
false, EvenDblSpc, 2, 4 ,
true},
257{ ARM::VLD2LNq16Pseudo_UPD, ARM::VLD2LNq16_UPD,
true,
true,
true, EvenDblSpc, 2, 4 ,
true},
258{ ARM::VLD2LNq32Pseudo, ARM::VLD2LNq32,
true,
false,
false, EvenDblSpc, 2, 2 ,
true},
259{ ARM::VLD2LNq32Pseudo_UPD, ARM::VLD2LNq32_UPD,
true,
true,
true, EvenDblSpc, 2, 2 ,
true},
261{ ARM::VLD2q16Pseudo, ARM::VLD2q16,
true,
false,
false, SingleSpc, 4, 4 ,
false},
262{ ARM::VLD2q16PseudoWB_fixed, ARM::VLD2q16wb_fixed,
true,
true,
false, SingleSpc, 4, 4 ,
false},
263{ ARM::VLD2q16PseudoWB_register, ARM::VLD2q16wb_register,
true,
true,
true, SingleSpc, 4, 4 ,
false},
264{ ARM::VLD2q32Pseudo, ARM::VLD2q32,
true,
false,
false, SingleSpc, 4, 2 ,
false},
265{ ARM::VLD2q32PseudoWB_fixed, ARM::VLD2q32wb_fixed,
true,
true,
false, SingleSpc, 4, 2 ,
false},
266{ ARM::VLD2q32PseudoWB_register, ARM::VLD2q32wb_register,
true,
true,
true, SingleSpc, 4, 2 ,
false},
267{ ARM::VLD2q8Pseudo, ARM::VLD2q8,
true,
false,
false, SingleSpc, 4, 8 ,
false},
268{ ARM::VLD2q8PseudoWB_fixed, ARM::VLD2q8wb_fixed,
true,
true,
false, SingleSpc, 4, 8 ,
false},
269{ ARM::VLD2q8PseudoWB_register, ARM::VLD2q8wb_register,
true,
true,
true, SingleSpc, 4, 8 ,
false},
271{ ARM::VLD3DUPd16Pseudo, ARM::VLD3DUPd16,
true,
false,
false, SingleSpc, 3, 4,
true},
272{ ARM::VLD3DUPd16Pseudo_UPD, ARM::VLD3DUPd16_UPD,
true,
true,
true, SingleSpc, 3, 4,
true},
273{ ARM::VLD3DUPd32Pseudo, ARM::VLD3DUPd32,
true,
false,
false, SingleSpc, 3, 2,
true},
274{ ARM::VLD3DUPd32Pseudo_UPD, ARM::VLD3DUPd32_UPD,
true,
true,
true, SingleSpc, 3, 2,
true},
275{ ARM::VLD3DUPd8Pseudo, ARM::VLD3DUPd8,
true,
false,
false, SingleSpc, 3, 8,
true},
276{ ARM::VLD3DUPd8Pseudo_UPD, ARM::VLD3DUPd8_UPD,
true,
true,
true, SingleSpc, 3, 8,
true},
277{ ARM::VLD3DUPq16EvenPseudo, ARM::VLD3DUPq16,
true,
false,
false, EvenDblSpc, 3, 4 ,
true},
278{ ARM::VLD3DUPq16OddPseudo, ARM::VLD3DUPq16,
true,
false,
false, OddDblSpc, 3, 4 ,
true},
279{ ARM::VLD3DUPq16OddPseudo_UPD, ARM::VLD3DUPq16_UPD,
true,
true,
true, OddDblSpc, 3, 4 ,
true},
280{ ARM::VLD3DUPq32EvenPseudo, ARM::VLD3DUPq32,
true,
false,
false, EvenDblSpc, 3, 2 ,
true},
281{ ARM::VLD3DUPq32OddPseudo, ARM::VLD3DUPq32,
true,
false,
false, OddDblSpc, 3, 2 ,
true},
282{ ARM::VLD3DUPq32OddPseudo_UPD, ARM::VLD3DUPq32_UPD,
true,
true,
true, OddDblSpc, 3, 2 ,
true},
283{ ARM::VLD3DUPq8EvenPseudo, ARM::VLD3DUPq8,
true,
false,
false, EvenDblSpc, 3, 8 ,
true},
284{ ARM::VLD3DUPq8OddPseudo, ARM::VLD3DUPq8,
true,
false,
false, OddDblSpc, 3, 8 ,
true},
285{ ARM::VLD3DUPq8OddPseudo_UPD, ARM::VLD3DUPq8_UPD,
true,
true,
true, OddDblSpc, 3, 8 ,
true},
287{ ARM::VLD3LNd16Pseudo, ARM::VLD3LNd16,
true,
false,
false, SingleSpc, 3, 4 ,
true},
288{ ARM::VLD3LNd16Pseudo_UPD, ARM::VLD3LNd16_UPD,
true,
true,
true, SingleSpc, 3, 4 ,
true},
289{ ARM::VLD3LNd32Pseudo, ARM::VLD3LNd32,
true,
false,
false, SingleSpc, 3, 2 ,
true},
290{ ARM::VLD3LNd32Pseudo_UPD, ARM::VLD3LNd32_UPD,
true,
true,
true, SingleSpc, 3, 2 ,
true},
291{ ARM::VLD3LNd8Pseudo, ARM::VLD3LNd8,
true,
false,
false, SingleSpc, 3, 8 ,
true},
292{ ARM::VLD3LNd8Pseudo_UPD, ARM::VLD3LNd8_UPD,
true,
true,
true, SingleSpc, 3, 8 ,
true},
293{ ARM::VLD3LNq16Pseudo, ARM::VLD3LNq16,
true,
false,
false, EvenDblSpc, 3, 4 ,
true},
294{ ARM::VLD3LNq16Pseudo_UPD, ARM::VLD3LNq16_UPD,
true,
true,
true, EvenDblSpc, 3, 4 ,
true},
295{ ARM::VLD3LNq32Pseudo, ARM::VLD3LNq32,
true,
false,
false, EvenDblSpc, 3, 2 ,
true},
296{ ARM::VLD3LNq32Pseudo_UPD, ARM::VLD3LNq32_UPD,
true,
true,
true, EvenDblSpc, 3, 2 ,
true},
298{ ARM::VLD3d16Pseudo, ARM::VLD3d16,
true,
false,
false, SingleSpc, 3, 4 ,
true},
299{ ARM::VLD3d16Pseudo_UPD, ARM::VLD3d16_UPD,
true,
true,
true, SingleSpc, 3, 4 ,
true},
300{ ARM::VLD3d32Pseudo, ARM::VLD3d32,
true,
false,
false, SingleSpc, 3, 2 ,
true},
301{ ARM::VLD3d32Pseudo_UPD, ARM::VLD3d32_UPD,
true,
true,
true, SingleSpc, 3, 2 ,
true},
302{ ARM::VLD3d8Pseudo, ARM::VLD3d8,
true,
false,
false, SingleSpc, 3, 8 ,
true},
303{ ARM::VLD3d8Pseudo_UPD, ARM::VLD3d8_UPD,
true,
true,
true, SingleSpc, 3, 8 ,
true},
305{ ARM::VLD3q16Pseudo_UPD, ARM::VLD3q16_UPD,
true,
true,
true, EvenDblSpc, 3, 4 ,
true},
306{ ARM::VLD3q16oddPseudo, ARM::VLD3q16,
true,
false,
false, OddDblSpc, 3, 4 ,
true},
307{ ARM::VLD3q16oddPseudo_UPD, ARM::VLD3q16_UPD,
true,
true,
true, OddDblSpc, 3, 4 ,
true},
308{ ARM::VLD3q32Pseudo_UPD, ARM::VLD3q32_UPD,
true,
true,
true, EvenDblSpc, 3, 2 ,
true},
309{ ARM::VLD3q32oddPseudo, ARM::VLD3q32,
true,
false,
false, OddDblSpc, 3, 2 ,
true},
310{ ARM::VLD3q32oddPseudo_UPD, ARM::VLD3q32_UPD,
true,
true,
true, OddDblSpc, 3, 2 ,
true},
311{ ARM::VLD3q8Pseudo_UPD, ARM::VLD3q8_UPD,
true,
true,
true, EvenDblSpc, 3, 8 ,
true},
312{ ARM::VLD3q8oddPseudo, ARM::VLD3q8,
true,
false,
false, OddDblSpc, 3, 8 ,
true},
313{ ARM::VLD3q8oddPseudo_UPD, ARM::VLD3q8_UPD,
true,
true,
true, OddDblSpc, 3, 8 ,
true},
315{ ARM::VLD4DUPd16Pseudo, ARM::VLD4DUPd16,
true,
false,
false, SingleSpc, 4, 4,
true},
316{ ARM::VLD4DUPd16Pseudo_UPD, ARM::VLD4DUPd16_UPD,
true,
true,
true, SingleSpc, 4, 4,
true},
317{ ARM::VLD4DUPd32Pseudo, ARM::VLD4DUPd32,
true,
false,
false, SingleSpc, 4, 2,
true},
318{ ARM::VLD4DUPd32Pseudo_UPD, ARM::VLD4DUPd32_UPD,
true,
true,
true, SingleSpc, 4, 2,
true},
319{ ARM::VLD4DUPd8Pseudo, ARM::VLD4DUPd8,
true,
false,
false, SingleSpc, 4, 8,
true},
320{ ARM::VLD4DUPd8Pseudo_UPD, ARM::VLD4DUPd8_UPD,
true,
true,
true, SingleSpc, 4, 8,
true},
321{ ARM::VLD4DUPq16EvenPseudo, ARM::VLD4DUPq16,
true,
false,
false, EvenDblSpc, 4, 4 ,
true},
322{ ARM::VLD4DUPq16OddPseudo, ARM::VLD4DUPq16,
true,
false,
false, OddDblSpc, 4, 4 ,
true},
323{ ARM::VLD4DUPq16OddPseudo_UPD, ARM::VLD4DUPq16_UPD,
true,
true,
true, OddDblSpc, 4, 4 ,
true},
324{ ARM::VLD4DUPq32EvenPseudo, ARM::VLD4DUPq32,
true,
false,
false, EvenDblSpc, 4, 2 ,
true},
325{ ARM::VLD4DUPq32OddPseudo, ARM::VLD4DUPq32,
true,
false,
false, OddDblSpc, 4, 2 ,
true},
326{ ARM::VLD4DUPq32OddPseudo_UPD, ARM::VLD4DUPq32_UPD,
true,
true,
true, OddDblSpc, 4, 2 ,
true},
327{ ARM::VLD4DUPq8EvenPseudo, ARM::VLD4DUPq8,
true,
false,
false, EvenDblSpc, 4, 8 ,
true},
328{ ARM::VLD4DUPq8OddPseudo, ARM::VLD4DUPq8,
true,
false,
false, OddDblSpc, 4, 8 ,
true},
329{ ARM::VLD4DUPq8OddPseudo_UPD, ARM::VLD4DUPq8_UPD,
true,
true,
true, OddDblSpc, 4, 8 ,
true},
331{ ARM::VLD4LNd16Pseudo, ARM::VLD4LNd16,
true,
false,
false, SingleSpc, 4, 4 ,
true},
332{ ARM::VLD4LNd16Pseudo_UPD, ARM::VLD4LNd16_UPD,
true,
true,
true, SingleSpc, 4, 4 ,
true},
333{ ARM::VLD4LNd32Pseudo, ARM::VLD4LNd32,
true,
false,
false, SingleSpc, 4, 2 ,
true},
334{ ARM::VLD4LNd32Pseudo_UPD, ARM::VLD4LNd32_UPD,
true,
true,
true, SingleSpc, 4, 2 ,
true},
335{ ARM::VLD4LNd8Pseudo, ARM::VLD4LNd8,
true,
false,
false, SingleSpc, 4, 8 ,
true},
336{ ARM::VLD4LNd8Pseudo_UPD, ARM::VLD4LNd8_UPD,
true,
true,
true, SingleSpc, 4, 8 ,
true},
337{ ARM::VLD4LNq16Pseudo, ARM::VLD4LNq16,
true,
false,
false, EvenDblSpc, 4, 4 ,
true},
338{ ARM::VLD4LNq16Pseudo_UPD, ARM::VLD4LNq16_UPD,
true,
true,
true, EvenDblSpc, 4, 4 ,
true},
339{ ARM::VLD4LNq32Pseudo, ARM::VLD4LNq32,
true,
false,
false, EvenDblSpc, 4, 2 ,
true},
340{ ARM::VLD4LNq32Pseudo_UPD, ARM::VLD4LNq32_UPD,
true,
true,
true, EvenDblSpc, 4, 2 ,
true},
342{ ARM::VLD4d16Pseudo, ARM::VLD4d16,
true,
false,
false, SingleSpc, 4, 4 ,
true},
343{ ARM::VLD4d16Pseudo_UPD, ARM::VLD4d16_UPD,
true,
true,
true, SingleSpc, 4, 4 ,
true},
344{ ARM::VLD4d32Pseudo, ARM::VLD4d32,
true,
false,
false, SingleSpc, 4, 2 ,
true},
345{ ARM::VLD4d32Pseudo_UPD, ARM::VLD4d32_UPD,
true,
true,
true, SingleSpc, 4, 2 ,
true},
346{ ARM::VLD4d8Pseudo, ARM::VLD4d8,
true,
false,
false, SingleSpc, 4, 8 ,
true},
347{ ARM::VLD4d8Pseudo_UPD, ARM::VLD4d8_UPD,
true,
true,
true, SingleSpc, 4, 8 ,
true},
349{ ARM::VLD4q16Pseudo_UPD, ARM::VLD4q16_UPD,
true,
true,
true, EvenDblSpc, 4, 4 ,
true},
350{ ARM::VLD4q16oddPseudo, ARM::VLD4q16,
true,
false,
false, OddDblSpc, 4, 4 ,
true},
351{ ARM::VLD4q16oddPseudo_UPD, ARM::VLD4q16_UPD,
true,
true,
true, OddDblSpc, 4, 4 ,
true},
352{ ARM::VLD4q32Pseudo_UPD, ARM::VLD4q32_UPD,
true,
true,
true, EvenDblSpc, 4, 2 ,
true},
353{ ARM::VLD4q32oddPseudo, ARM::VLD4q32,
true,
false,
false, OddDblSpc, 4, 2 ,
true},
354{ ARM::VLD4q32oddPseudo_UPD, ARM::VLD4q32_UPD,
true,
true,
true, OddDblSpc, 4, 2 ,
true},
355{ ARM::VLD4q8Pseudo_UPD, ARM::VLD4q8_UPD,
true,
true,
true, EvenDblSpc, 4, 8 ,
true},
356{ ARM::VLD4q8oddPseudo, ARM::VLD4q8,
true,
false,
false, OddDblSpc, 4, 8 ,
true},
357{ ARM::VLD4q8oddPseudo_UPD, ARM::VLD4q8_UPD,
true,
true,
true, OddDblSpc, 4, 8 ,
true},
359{ ARM::VST1LNq16Pseudo, ARM::VST1LNd16,
false,
false,
false, EvenDblSpc, 1, 4 ,
true},
360{ ARM::VST1LNq16Pseudo_UPD, ARM::VST1LNd16_UPD,
false,
true,
true, EvenDblSpc, 1, 4 ,
true},
361{ ARM::VST1LNq32Pseudo, ARM::VST1LNd32,
false,
false,
false, EvenDblSpc, 1, 2 ,
true},
362{ ARM::VST1LNq32Pseudo_UPD, ARM::VST1LNd32_UPD,
false,
true,
true, EvenDblSpc, 1, 2 ,
true},
363{ ARM::VST1LNq8Pseudo, ARM::VST1LNd8,
false,
false,
false, EvenDblSpc, 1, 8 ,
true},
364{ ARM::VST1LNq8Pseudo_UPD, ARM::VST1LNd8_UPD,
false,
true,
true, EvenDblSpc, 1, 8 ,
true},
366{ ARM::VST1d16QPseudo, ARM::VST1d16Q,
false,
false,
false, SingleSpc, 4, 4 ,
false},
367{ ARM::VST1d16QPseudoWB_fixed, ARM::VST1d16Qwb_fixed,
false,
true,
false, SingleSpc, 4, 4 ,
false},
368{ ARM::VST1d16QPseudoWB_register, ARM::VST1d16Qwb_register,
false,
true,
true, SingleSpc, 4, 4 ,
false},
369{ ARM::VST1d16TPseudo, ARM::VST1d16T,
false,
false,
false, SingleSpc, 3, 4 ,
false},
370{ ARM::VST1d16TPseudoWB_fixed, ARM::VST1d16Twb_fixed,
false,
true,
false, SingleSpc, 3, 4 ,
false},
371{ ARM::VST1d16TPseudoWB_register, ARM::VST1d16Twb_register,
false,
true,
true, SingleSpc, 3, 4 ,
false},
373{ ARM::VST1d32QPseudo, ARM::VST1d32Q,
false,
false,
false, SingleSpc, 4, 2 ,
false},
374{ ARM::VST1d32QPseudoWB_fixed, ARM::VST1d32Qwb_fixed,
false,
true,
false, SingleSpc, 4, 2 ,
false},
375{ ARM::VST1d32QPseudoWB_register, ARM::VST1d32Qwb_register,
false,
true,
true, SingleSpc, 4, 2 ,
false},
376{ ARM::VST1d32TPseudo, ARM::VST1d32T,
false,
false,
false, SingleSpc, 3, 2 ,
false},
377{ ARM::VST1d32TPseudoWB_fixed, ARM::VST1d32Twb_fixed,
false,
true,
false, SingleSpc, 3, 2 ,
false},
378{ ARM::VST1d32TPseudoWB_register, ARM::VST1d32Twb_register,
false,
true,
true, SingleSpc, 3, 2 ,
false},
380{ ARM::VST1d64QPseudo, ARM::VST1d64Q,
false,
false,
false, SingleSpc, 4, 1 ,
false},
381{ ARM::VST1d64QPseudoWB_fixed, ARM::VST1d64Qwb_fixed,
false,
true,
false, SingleSpc, 4, 1 ,
false},
382{ ARM::VST1d64QPseudoWB_register, ARM::VST1d64Qwb_register,
false,
true,
true, SingleSpc, 4, 1 ,
false},
383{ ARM::VST1d64TPseudo, ARM::VST1d64T,
false,
false,
false, SingleSpc, 3, 1 ,
false},
384{ ARM::VST1d64TPseudoWB_fixed, ARM::VST1d64Twb_fixed,
false,
true,
false, SingleSpc, 3, 1 ,
false},
385{ ARM::VST1d64TPseudoWB_register, ARM::VST1d64Twb_register,
false,
true,
true, SingleSpc, 3, 1 ,
false},
387{ ARM::VST1d8QPseudo, ARM::VST1d8Q,
false,
false,
false, SingleSpc, 4, 8 ,
false},
388{ ARM::VST1d8QPseudoWB_fixed, ARM::VST1d8Qwb_fixed,
false,
true,
false, SingleSpc, 4, 8 ,
false},
389{ ARM::VST1d8QPseudoWB_register, ARM::VST1d8Qwb_register,
false,
true,
true, SingleSpc, 4, 8 ,
false},
390{ ARM::VST1d8TPseudo, ARM::VST1d8T,
false,
false,
false, SingleSpc, 3, 8 ,
false},
391{ ARM::VST1d8TPseudoWB_fixed, ARM::VST1d8Twb_fixed,
false,
true,
false, SingleSpc, 3, 8 ,
false},
392{ ARM::VST1d8TPseudoWB_register, ARM::VST1d8Twb_register,
false,
true,
true, SingleSpc, 3, 8 ,
false},
394{ ARM::VST1q16HighQPseudo, ARM::VST1d16Q,
false,
false,
false, SingleHighQSpc, 4, 4 ,
false},
395{ ARM::VST1q16HighQPseudo_UPD, ARM::VST1d16Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
396{ ARM::VST1q16HighTPseudo, ARM::VST1d16T,
false,
false,
false, SingleHighTSpc, 3, 4 ,
false},
397{ ARM::VST1q16HighTPseudo_UPD, ARM::VST1d16Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 4 ,
false},
398{ ARM::VST1q16LowQPseudo_UPD, ARM::VST1d16Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 4 ,
false},
399{ ARM::VST1q16LowTPseudo_UPD, ARM::VST1d16Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 4 ,
false},
401{ ARM::VST1q32HighQPseudo, ARM::VST1d32Q,
false,
false,
false, SingleHighQSpc, 4, 2 ,
false},
402{ ARM::VST1q32HighQPseudo_UPD, ARM::VST1d32Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
403{ ARM::VST1q32HighTPseudo, ARM::VST1d32T,
false,
false,
false, SingleHighTSpc, 3, 2 ,
false},
404{ ARM::VST1q32HighTPseudo_UPD, ARM::VST1d32Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 2 ,
false},
405{ ARM::VST1q32LowQPseudo_UPD, ARM::VST1d32Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 2 ,
false},
406{ ARM::VST1q32LowTPseudo_UPD, ARM::VST1d32Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 2 ,
false},
408{ ARM::VST1q64HighQPseudo, ARM::VST1d64Q,
false,
false,
false, SingleHighQSpc, 4, 1 ,
false},
409{ ARM::VST1q64HighQPseudo_UPD, ARM::VST1d64Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
410{ ARM::VST1q64HighTPseudo, ARM::VST1d64T,
false,
false,
false, SingleHighTSpc, 3, 1 ,
false},
411{ ARM::VST1q64HighTPseudo_UPD, ARM::VST1d64Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 1 ,
false},
412{ ARM::VST1q64LowQPseudo_UPD, ARM::VST1d64Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 1 ,
false},
413{ ARM::VST1q64LowTPseudo_UPD, ARM::VST1d64Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 1 ,
false},
415{ ARM::VST1q8HighQPseudo, ARM::VST1d8Q,
false,
false,
false, SingleHighQSpc, 4, 8 ,
false},
416{ ARM::VST1q8HighQPseudo_UPD, ARM::VST1d8Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
417{ ARM::VST1q8HighTPseudo, ARM::VST1d8T,
false,
false,
false, SingleHighTSpc, 3, 8 ,
false},
418{ ARM::VST1q8HighTPseudo_UPD, ARM::VST1d8Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 8 ,
false},
419{ ARM::VST1q8LowQPseudo_UPD, ARM::VST1d8Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 8 ,
false},
420{ ARM::VST1q8LowTPseudo_UPD, ARM::VST1d8Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 8 ,
false},
422{ ARM::VST2LNd16Pseudo, ARM::VST2LNd16,
false,
false,
false, SingleSpc, 2, 4 ,
true},
423{ ARM::VST2LNd16Pseudo_UPD, ARM::VST2LNd16_UPD,
false,
true,
true, SingleSpc, 2, 4 ,
true},
424{ ARM::VST2LNd32Pseudo, ARM::VST2LNd32,
false,
false,
false, SingleSpc, 2, 2 ,
true},
425{ ARM::VST2LNd32Pseudo_UPD, ARM::VST2LNd32_UPD,
false,
true,
true, SingleSpc, 2, 2 ,
true},
426{ ARM::VST2LNd8Pseudo, ARM::VST2LNd8,
false,
false,
false, SingleSpc, 2, 8 ,
true},
427{ ARM::VST2LNd8Pseudo_UPD, ARM::VST2LNd8_UPD,
false,
true,
true, SingleSpc, 2, 8 ,
true},
428{ ARM::VST2LNq16Pseudo, ARM::VST2LNq16,
false,
false,
false, EvenDblSpc, 2, 4,
true},
429{ ARM::VST2LNq16Pseudo_UPD, ARM::VST2LNq16_UPD,
false,
true,
true, EvenDblSpc, 2, 4,
true},
430{ ARM::VST2LNq32Pseudo, ARM::VST2LNq32,
false,
false,
false, EvenDblSpc, 2, 2,
true},
431{ ARM::VST2LNq32Pseudo_UPD, ARM::VST2LNq32_UPD,
false,
true,
true, EvenDblSpc, 2, 2,
true},
433{ ARM::VST2q16Pseudo, ARM::VST2q16,
false,
false,
false, SingleSpc, 4, 4 ,
false},
434{ ARM::VST2q16PseudoWB_fixed, ARM::VST2q16wb_fixed,
false,
true,
false, SingleSpc, 4, 4 ,
false},
435{ ARM::VST2q16PseudoWB_register, ARM::VST2q16wb_register,
false,
true,
true, SingleSpc, 4, 4 ,
false},
436{ ARM::VST2q32Pseudo, ARM::VST2q32,
false,
false,
false, SingleSpc, 4, 2 ,
false},
437{ ARM::VST2q32PseudoWB_fixed, ARM::VST2q32wb_fixed,
false,
true,
false, SingleSpc, 4, 2 ,
false},
438{ ARM::VST2q32PseudoWB_register, ARM::VST2q32wb_register,
false,
true,
true, SingleSpc, 4, 2 ,
false},
439{ ARM::VST2q8Pseudo, ARM::VST2q8,
false,
false,
false, SingleSpc, 4, 8 ,
false},
440{ ARM::VST2q8PseudoWB_fixed, ARM::VST2q8wb_fixed,
false,
true,
false, SingleSpc, 4, 8 ,
false},
441{ ARM::VST2q8PseudoWB_register, ARM::VST2q8wb_register,
false,
true,
true, SingleSpc, 4, 8 ,
false},
443{ ARM::VST3LNd16Pseudo, ARM::VST3LNd16,
false,
false,
false, SingleSpc, 3, 4 ,
true},
444{ ARM::VST3LNd16Pseudo_UPD, ARM::VST3LNd16_UPD,
false,
true,
true, SingleSpc, 3, 4 ,
true},
445{ ARM::VST3LNd32Pseudo, ARM::VST3LNd32,
false,
false,
false, SingleSpc, 3, 2 ,
true},
446{ ARM::VST3LNd32Pseudo_UPD, ARM::VST3LNd32_UPD,
false,
true,
true, SingleSpc, 3, 2 ,
true},
447{ ARM::VST3LNd8Pseudo, ARM::VST3LNd8,
false,
false,
false, SingleSpc, 3, 8 ,
true},
448{ ARM::VST3LNd8Pseudo_UPD, ARM::VST3LNd8_UPD,
false,
true,
true, SingleSpc, 3, 8 ,
true},
449{ ARM::VST3LNq16Pseudo, ARM::VST3LNq16,
false,
false,
false, EvenDblSpc, 3, 4,
true},
450{ ARM::VST3LNq16Pseudo_UPD, ARM::VST3LNq16_UPD,
false,
true,
true, EvenDblSpc, 3, 4,
true},
451{ ARM::VST3LNq32Pseudo, ARM::VST3LNq32,
false,
false,
false, EvenDblSpc, 3, 2,
true},
452{ ARM::VST3LNq32Pseudo_UPD, ARM::VST3LNq32_UPD,
false,
true,
true, EvenDblSpc, 3, 2,
true},
454{ ARM::VST3d16Pseudo, ARM::VST3d16,
false,
false,
false, SingleSpc, 3, 4 ,
true},
455{ ARM::VST3d16Pseudo_UPD, ARM::VST3d16_UPD,
false,
true,
true, SingleSpc, 3, 4 ,
true},
456{ ARM::VST3d32Pseudo, ARM::VST3d32,
false,
false,
false, SingleSpc, 3, 2 ,
true},
457{ ARM::VST3d32Pseudo_UPD, ARM::VST3d32_UPD,
false,
true,
true, SingleSpc, 3, 2 ,
true},
458{ ARM::VST3d8Pseudo, ARM::VST3d8,
false,
false,
false, SingleSpc, 3, 8 ,
true},
459{ ARM::VST3d8Pseudo_UPD, ARM::VST3d8_UPD,
false,
true,
true, SingleSpc, 3, 8 ,
true},
461{ ARM::VST3q16Pseudo_UPD, ARM::VST3q16_UPD,
false,
true,
true, EvenDblSpc, 3, 4 ,
true},
462{ ARM::VST3q16oddPseudo, ARM::VST3q16,
false,
false,
false, OddDblSpc, 3, 4 ,
true},
463{ ARM::VST3q16oddPseudo_UPD, ARM::VST3q16_UPD,
false,
true,
true, OddDblSpc, 3, 4 ,
true},
464{ ARM::VST3q32Pseudo_UPD, ARM::VST3q32_UPD,
false,
true,
true, EvenDblSpc, 3, 2 ,
true},
465{ ARM::VST3q32oddPseudo, ARM::VST3q32,
false,
false,
false, OddDblSpc, 3, 2 ,
true},
466{ ARM::VST3q32oddPseudo_UPD, ARM::VST3q32_UPD,
false,
true,
true, OddDblSpc, 3, 2 ,
true},
467{ ARM::VST3q8Pseudo_UPD, ARM::VST3q8_UPD,
false,
true,
true, EvenDblSpc, 3, 8 ,
true},
468{ ARM::VST3q8oddPseudo, ARM::VST3q8,
false,
false,
false, OddDblSpc, 3, 8 ,
true},
469{ ARM::VST3q8oddPseudo_UPD, ARM::VST3q8_UPD,
false,
true,
true, OddDblSpc, 3, 8 ,
true},
471{ ARM::VST4LNd16Pseudo, ARM::VST4LNd16,
false,
false,
false, SingleSpc, 4, 4 ,
true},
472{ ARM::VST4LNd16Pseudo_UPD, ARM::VST4LNd16_UPD,
false,
true,
true, SingleSpc, 4, 4 ,
true},
473{ ARM::VST4LNd32Pseudo, ARM::VST4LNd32,
false,
false,
false, SingleSpc, 4, 2 ,
true},
474{ ARM::VST4LNd32Pseudo_UPD, ARM::VST4LNd32_UPD,
false,
true,
true, SingleSpc, 4, 2 ,
true},
475{ ARM::VST4LNd8Pseudo, ARM::VST4LNd8,
false,
false,
false, SingleSpc, 4, 8 ,
true},
476{ ARM::VST4LNd8Pseudo_UPD, ARM::VST4LNd8_UPD,
false,
true,
true, SingleSpc, 4, 8 ,
true},
477{ ARM::VST4LNq16Pseudo, ARM::VST4LNq16,
false,
false,
false, EvenDblSpc, 4, 4,
true},
478{ ARM::VST4LNq16Pseudo_UPD, ARM::VST4LNq16_UPD,
false,
true,
true, EvenDblSpc, 4, 4,
true},
479{ ARM::VST4LNq32Pseudo, ARM::VST4LNq32,
false,
false,
false, EvenDblSpc, 4, 2,
true},
480{ ARM::VST4LNq32Pseudo_UPD, ARM::VST4LNq32_UPD,
false,
true,
true, EvenDblSpc, 4, 2,
true},
482{ ARM::VST4d16Pseudo, ARM::VST4d16,
false,
false,
false, SingleSpc, 4, 4 ,
true},
483{ ARM::VST4d16Pseudo_UPD, ARM::VST4d16_UPD,
false,
true,
true, SingleSpc, 4, 4 ,
true},
484{ ARM::VST4d32Pseudo, ARM::VST4d32,
false,
false,
false, SingleSpc, 4, 2 ,
true},
485{ ARM::VST4d32Pseudo_UPD, ARM::VST4d32_UPD,
false,
true,
true, SingleSpc, 4, 2 ,
true},
486{ ARM::VST4d8Pseudo, ARM::VST4d8,
false,
false,
false, SingleSpc, 4, 8 ,
true},
487{ ARM::VST4d8Pseudo_UPD, ARM::VST4d8_UPD,
false,
true,
true, SingleSpc, 4, 8 ,
true},
489{ ARM::VST4q16Pseudo_UPD, ARM::VST4q16_UPD,
false,
true,
true, EvenDblSpc, 4, 4 ,
true},
490{ ARM::VST4q16oddPseudo, ARM::VST4q16,
false,
false,
false, OddDblSpc, 4, 4 ,
true},
491{ ARM::VST4q16oddPseudo_UPD, ARM::VST4q16_UPD,
false,
true,
true, OddDblSpc, 4, 4 ,
true},
492{ ARM::VST4q32Pseudo_UPD, ARM::VST4q32_UPD,
false,
true,
true, EvenDblSpc, 4, 2 ,
true},
493{ ARM::VST4q32oddPseudo, ARM::VST4q32,
false,
false,
false, OddDblSpc, 4, 2 ,
true},
494{ ARM::VST4q32oddPseudo_UPD, ARM::VST4q32_UPD,
false,
true,
true, OddDblSpc, 4, 2 ,
true},
495{ ARM::VST4q8Pseudo_UPD, ARM::VST4q8_UPD,
false,
true,
true, EvenDblSpc, 4, 8 ,
true},
496{ ARM::VST4q8oddPseudo, ARM::VST4q8,
false,
false,
false, OddDblSpc, 4, 8 ,
true},
497{ ARM::VST4q8oddPseudo_UPD, ARM::VST4q8_UPD,
false,
true,
true, OddDblSpc, 4, 8 ,
true}
505 static std::atomic<bool> TableChecked(
false);
506 if (!TableChecked.load(std::memory_order_relaxed)) {
508 TableChecked.store(
true, std::memory_order_relaxed);
524 if (RegSpc == SingleSpc || RegSpc == SingleLowSpc) {
525 D0 =
TRI->getSubReg(
Reg, ARM::dsub_0);
526 D1 =
TRI->getSubReg(
Reg, ARM::dsub_1);
527 D2 =
TRI->getSubReg(
Reg, ARM::dsub_2);
528 D3 =
TRI->getSubReg(
Reg, ARM::dsub_3);
529 }
else if (RegSpc == SingleHighQSpc) {
530 D0 =
TRI->getSubReg(
Reg, ARM::dsub_4);
531 D1 =
TRI->getSubReg(
Reg, ARM::dsub_5);
532 D2 =
TRI->getSubReg(
Reg, ARM::dsub_6);
533 D3 =
TRI->getSubReg(
Reg, ARM::dsub_7);
534 }
else if (RegSpc == SingleHighTSpc) {
535 D0 =
TRI->getSubReg(
Reg, ARM::dsub_3);
536 D1 =
TRI->getSubReg(
Reg, ARM::dsub_4);
537 D2 =
TRI->getSubReg(
Reg, ARM::dsub_5);
538 D3 =
TRI->getSubReg(
Reg, ARM::dsub_6);
539 }
else if (RegSpc == EvenDblSpc) {
540 D0 =
TRI->getSubReg(
Reg, ARM::dsub_0);
541 D1 =
TRI->getSubReg(
Reg, ARM::dsub_2);
542 D2 =
TRI->getSubReg(
Reg, ARM::dsub_4);
543 D3 =
TRI->getSubReg(
Reg, ARM::dsub_6);
545 assert(RegSpc == OddDblSpc &&
"unknown register spacing");
546 D0 =
TRI->getSubReg(
Reg, ARM::dsub_1);
547 D1 =
TRI->getSubReg(
Reg, ARM::dsub_3);
548 D2 =
TRI->getSubReg(
Reg, ARM::dsub_5);
549 D3 =
TRI->getSubReg(
Reg, ARM::dsub_7);
561 assert(TableEntry && TableEntry->IsLoad &&
"NEONLdStTable lookup failed");
562 NEONRegSpacing RegSpc = (NEONRegSpacing)TableEntry->RegSpacing;
563 unsigned NumRegs = TableEntry->NumRegs;
566 TII->get(TableEntry->RealOpc));
569 bool DstIsDead =
MI.getOperand(OpIdx).isDead();
570 Register DstReg =
MI.getOperand(OpIdx++).getReg();
572 bool IsVLD2DUP = TableEntry->RealOpc == ARM::VLD2DUPd8x2 ||
573 TableEntry->RealOpc == ARM::VLD2DUPd16x2 ||
574 TableEntry->RealOpc == ARM::VLD2DUPd32x2 ||
575 TableEntry->RealOpc == ARM::VLD2DUPd8x2wb_fixed ||
576 TableEntry->RealOpc == ARM::VLD2DUPd16x2wb_fixed ||
577 TableEntry->RealOpc == ARM::VLD2DUPd32x2wb_fixed ||
578 TableEntry->RealOpc == ARM::VLD2DUPd8x2wb_register ||
579 TableEntry->RealOpc == ARM::VLD2DUPd16x2wb_register ||
580 TableEntry->RealOpc == ARM::VLD2DUPd32x2wb_register;
583 unsigned SubRegIndex;
584 if (RegSpc == EvenDblSpc) {
585 SubRegIndex = ARM::dsub_0;
587 assert(RegSpc == OddDblSpc &&
"Unexpected spacing!");
588 SubRegIndex = ARM::dsub_1;
590 Register SubReg =
TRI->getSubReg(DstReg, SubRegIndex);
591 MCRegister DstRegPair =
592 TRI->getMatchingSuperReg(SubReg, ARM::dsub_0, &ARM::DPairSpcRegClass);
595 MCRegister D0, D1, D2, D3;
598 if (NumRegs > 1 && TableEntry->copyAllListRegs)
600 if (NumRegs > 2 && TableEntry->copyAllListRegs)
602 if (NumRegs > 3 && TableEntry->copyAllListRegs)
606 if (TableEntry->isUpdating)
607 MIB.
add(
MI.getOperand(OpIdx++));
610 MIB.
add(
MI.getOperand(OpIdx++));
611 MIB.
add(
MI.getOperand(OpIdx++));
614 if (TableEntry->hasWritebackOperand) {
622 const MachineOperand &AM6Offset =
MI.getOperand(OpIdx++);
623 if (TableEntry->RealOpc == ARM::VLD1d8Qwb_fixed ||
624 TableEntry->RealOpc == ARM::VLD1d16Qwb_fixed ||
625 TableEntry->RealOpc == ARM::VLD1d32Qwb_fixed ||
626 TableEntry->RealOpc == ARM::VLD1d64Qwb_fixed ||
627 TableEntry->RealOpc == ARM::VLD1d8Twb_fixed ||
628 TableEntry->RealOpc == ARM::VLD1d16Twb_fixed ||
629 TableEntry->RealOpc == ARM::VLD1d32Twb_fixed ||
630 TableEntry->RealOpc == ARM::VLD1d64Twb_fixed ||
631 TableEntry->RealOpc == ARM::VLD2DUPd8x2wb_fixed ||
632 TableEntry->RealOpc == ARM::VLD2DUPd16x2wb_fixed ||
633 TableEntry->RealOpc == ARM::VLD2DUPd32x2wb_fixed) {
635 "A fixed writing-back pseudo instruction provides an offset "
645 unsigned SrcOpIdx = 0;
646 if (RegSpc == EvenDblSpc || RegSpc == OddDblSpc || RegSpc == SingleLowSpc ||
647 RegSpc == SingleHighQSpc || RegSpc == SingleHighTSpc)
651 MIB.
add(
MI.getOperand(OpIdx++));
652 MIB.
add(
MI.getOperand(OpIdx++));
657 MachineOperand MO =
MI.getOperand(SrcOpIdx);
667 MI.eraseFromParent();
679 assert(TableEntry && !TableEntry->IsLoad &&
"NEONLdStTable lookup failed");
680 NEONRegSpacing RegSpc = (NEONRegSpacing)TableEntry->RegSpacing;
681 unsigned NumRegs = TableEntry->NumRegs;
684 TII->get(TableEntry->RealOpc));
686 if (TableEntry->isUpdating)
687 MIB.
add(
MI.getOperand(OpIdx++));
690 MIB.
add(
MI.getOperand(OpIdx++));
691 MIB.
add(
MI.getOperand(OpIdx++));
693 if (TableEntry->hasWritebackOperand) {
701 const MachineOperand &AM6Offset =
MI.getOperand(OpIdx++);
702 if (TableEntry->RealOpc == ARM::VST1d8Qwb_fixed ||
703 TableEntry->RealOpc == ARM::VST1d16Qwb_fixed ||
704 TableEntry->RealOpc == ARM::VST1d32Qwb_fixed ||
705 TableEntry->RealOpc == ARM::VST1d64Qwb_fixed ||
706 TableEntry->RealOpc == ARM::VST1d8Twb_fixed ||
707 TableEntry->RealOpc == ARM::VST1d16Twb_fixed ||
708 TableEntry->RealOpc == ARM::VST1d32Twb_fixed ||
709 TableEntry->RealOpc == ARM::VST1d64Twb_fixed) {
711 "A fixed writing-back pseudo instruction provides an offset "
718 bool SrcIsKill =
MI.getOperand(OpIdx).isKill();
719 bool SrcIsUndef =
MI.getOperand(OpIdx).isUndef();
720 Register SrcReg =
MI.getOperand(OpIdx++).getReg();
721 MCRegister D0, D1, D2, D3;
724 if (NumRegs > 1 && TableEntry->copyAllListRegs)
726 if (NumRegs > 2 && TableEntry->copyAllListRegs)
728 if (NumRegs > 3 && TableEntry->copyAllListRegs)
732 MIB.
add(
MI.getOperand(OpIdx++));
733 MIB.
add(
MI.getOperand(OpIdx++));
735 if (SrcIsKill && !SrcIsUndef)
737 else if (!SrcIsUndef)
738 MIB.
addReg(SrcReg, RegState::Implicit);
743 MI.eraseFromParent();
755 assert(TableEntry &&
"NEONLdStTable lookup failed");
756 NEONRegSpacing RegSpc = (NEONRegSpacing)TableEntry->RegSpacing;
757 unsigned NumRegs = TableEntry->NumRegs;
758 unsigned RegElts = TableEntry->RegElts;
761 TII->get(TableEntry->RealOpc));
765 unsigned Lane =
MI.getOperand(
MI.getDesc().getNumOperands() - 3).getImm();
768 assert(RegSpc != OddDblSpc &&
"unexpected register spacing for VLD/VST-lane");
769 if (RegSpc == EvenDblSpc && Lane >= RegElts) {
773 assert(Lane < RegElts &&
"out of range lane for VLD/VST-lane");
775 MCRegister D0, D1, D2, D3;
777 bool DstIsDead =
false;
778 if (TableEntry->IsLoad) {
779 DstIsDead =
MI.getOperand(OpIdx).isDead();
780 DstReg =
MI.getOperand(OpIdx++).getReg();
791 if (TableEntry->isUpdating)
792 MIB.
add(
MI.getOperand(OpIdx++));
795 MIB.
add(
MI.getOperand(OpIdx++));
796 MIB.
add(
MI.getOperand(OpIdx++));
798 if (TableEntry->hasWritebackOperand)
799 MIB.
add(
MI.getOperand(OpIdx++));
802 MachineOperand MO =
MI.getOperand(OpIdx++);
803 if (!TableEntry->IsLoad)
822 MIB.
add(
MI.getOperand(OpIdx++));
823 MIB.
add(
MI.getOperand(OpIdx++));
828 if (TableEntry->IsLoad)
834 MI.eraseFromParent();
840 unsigned Opc,
bool IsExt) {
849 MIB.
add(
MI.getOperand(OpIdx++));
851 MachineOperand VdSrc(
MI.getOperand(OpIdx++));
855 bool SrcIsKill =
MI.getOperand(OpIdx).isKill();
856 Register SrcReg =
MI.getOperand(OpIdx++).getReg();
857 MCRegister D0, D1, D2, D3;
862 MachineOperand VmSrc(
MI.getOperand(OpIdx++));
866 MIB.
add(
MI.getOperand(OpIdx++));
867 MIB.
add(
MI.getOperand(OpIdx++));
872 MI.eraseFromParent();
880 MI.getOpcode() == ARM::MQQPRStore ||
MI.getOpcode() == ARM::MQQQQPRStore
883 MachineInstrBuilder MIB =
891 MIB.
add(
MI.getOperand(1));
893 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_0), Flags);
894 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_1), Flags);
895 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_2), Flags);
896 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_3), Flags);
897 if (
MI.getOpcode() == ARM::MQQQQPRStore ||
898 MI.getOpcode() == ARM::MQQQQPRLoad) {
899 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_4), Flags);
900 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_5), Flags);
901 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_6), Flags);
902 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_7), Flags);
905 if (NewOpc == ARM::VSTMDIA)
906 MIB.
addReg(SrcReg, RegState::Implicit);
910 MI.eraseFromParent();
959 unsigned TargetFlag) {
964 switch (TargetFlag) {
978 Imm = (
Imm >> 16) & 0xffff;
999void ARMExpandPseudo::ExpandTMOV32BitImm(MachineBasicBlock &
MBB,
1001 MachineInstr &
MI = *
MBBI;
1003 bool DstIsDead =
MI.getOperand(0).isDead();
1004 const MachineOperand &MO =
MI.getOperand(1);
1005 unsigned MIFlags =
MI.getFlags();
1014 unsigned PendingShift = 0;
1015 for (
unsigned Byte = 0;
Byte < 4; ++
Byte) {
1021 bool ZeroImm = Operand.
isImm() && Operand.
getImm() == 0;
1022 unsigned Op = PendingShift ? ARM::tADDi8 : ARM::tMOVi8;
1026 if (PendingShift && (!ZeroImm || Byte == 3)) {
1041 MachineInstrBuilder MIB =
1044 if (
Op == ARM::tADDi8)
1054 if (PendingShift || !ZeroImm)
1060 (--
MBBI)->getOperand(0).setIsDead(DstIsDead);
1062 MI.eraseFromParent();
1065void ARMExpandPseudo::ExpandMOV32BitImm(MachineBasicBlock &
MBB,
1067 MachineInstr &
MI = *
MBBI;
1068 unsigned Opcode =
MI.getOpcode();
1072 bool DstIsDead =
MI.getOperand(0).isDead();
1073 bool isCC = Opcode == ARM::MOVCCi32imm || Opcode == ARM::t2MOVCCi32imm;
1074 const MachineOperand &MO =
MI.getOperand(isCC ? 2 : 1);
1079 if (!STI->hasV6T2Ops() &&
1080 (Opcode == ARM::MOVi32imm || Opcode == ARM::MOVCCi32imm)) {
1084 assert (MO.
isImm() &&
"MOVi32imm w/ non-immediate source operand!");
1085 unsigned ImmVal = (unsigned)MO.
getImm();
1086 unsigned SOImmValV1 = 0, SOImmValV2 = 0;
1102 SOImmValV1 = ~(-SOImmValV1);
1105 unsigned MIFlags =
MI.getFlags();
1110 LO16.setMIFlags(MIFlags);
1111 HI16.setMIFlags(MIFlags);
1116 LO16.copyImplicitOps(
MI);
1117 HI16.copyImplicitOps(
MI);
1118 MI.eraseFromParent();
1122 unsigned LO16Opc = 0;
1123 unsigned HI16Opc = 0;
1124 unsigned MIFlags =
MI.getFlags();
1125 if (Opcode == ARM::t2MOVi32imm || Opcode == ARM::t2MOVCCi32imm) {
1126 LO16Opc = ARM::t2MOVi16;
1127 HI16Opc = ARM::t2MOVTi16;
1129 LO16Opc = ARM::MOVi16;
1130 HI16Opc = ARM::MOVTi16;
1134 LO16.setMIFlags(MIFlags);
1140 LO16.copyImplicitOps(
MI);
1144 if (!(HIOperand.isImm() && HIOperand.getImm() == 0)) {
1148 HI16.setMIFlags(MIFlags);
1149 HI16.add(HIOperand);
1152 HI16.copyImplicitOps(
MI);
1155 LO16->getOperand(0).setIsDead(DstIsDead);
1158 if (RequiresBundling)
1161 MI.eraseFromParent();
1169 const std::initializer_list<unsigned> &Regs,
1173 if (!
Op.isReg() || !
Op.isUse())
1179 std::set_difference(Regs.begin(), Regs.end(), OpRegs.
begin(), OpRegs.
end(),
1180 std::back_inserter(ClearRegs));
1183void ARMExpandPseudo::CMSEClearGPRegs(
1185 const DebugLoc &
DL,
const SmallVectorImpl<Register> &ClearRegs,
1188 if (STI->hasV8_1MMainlineOps()) {
1190 MachineInstrBuilder CLRM =
1193 CLRM.
addReg(R, RegState::Define);
1194 CLRM.
addReg(ARM::APSR, RegState::Define);
1195 CLRM.
addReg(ARM::CPSR, RegState::Define | RegState::Implicit);
1200 if (
Reg == ClobberReg)
1208 .
addImm(STI->hasDSP() ? 0xc00 : 0x800)
1227 if ((
Reg >= ARM::Q0 &&
Reg <= ARM::Q7) ||
1228 (
Reg >= ARM::D0 &&
Reg <= ARM::D15) ||
1229 (
Reg >= ARM::S0 &&
Reg <= ARM::S31))
1234 if (
Reg >= ARM::Q0 &&
Reg <= ARM::Q7) {
1235 int R =
Reg - ARM::Q0;
1236 ClearRegs.
reset(R * 4, (R + 1) * 4);
1237 }
else if (
Reg >= ARM::D0 &&
Reg <= ARM::D15) {
1238 int R =
Reg - ARM::D0;
1239 ClearRegs.
reset(R * 2, (R + 1) * 2);
1240 }
else if (
Reg >= ARM::S0 &&
Reg <= ARM::S31) {
1241 ClearRegs[
Reg - ARM::S0] =
false;
1248ARMExpandPseudo::CMSEClearFPRegs(MachineBasicBlock &
MBB,
1250 BitVector ClearRegs(16,
true);
1253 if (STI->hasV8_1MMainlineOps())
1254 return CMSEClearFPRegsV81(
MBB,
MBBI, ClearRegs);
1256 return CMSEClearFPRegsV8(
MBB,
MBBI, ClearRegs);
1262ARMExpandPseudo::CMSEClearFPRegsV8(MachineBasicBlock &
MBB,
1264 const BitVector &ClearRegs) {
1265 if (!STI->hasFPRegs())
1274 MachineBasicBlock *ClearBB, *DoneBB;
1276 ClearBB = DoneBB = &
MBB;
1293 for (
const MachineOperand &
Op : RetI.operands()) {
1319 .
addReg(ARM::CPSR, RegState::Kill);
1323 for (
unsigned D = 0;
D < 8;
D++) {
1325 if (ClearRegs[
D * 2 + 0] && ClearRegs[
D * 2 + 1]) {
1326 unsigned Reg = ARM::D0 +
D;
1333 if (ClearRegs[
D * 2 + 0]) {
1334 unsigned Reg = ARM::S0 +
D * 2;
1340 if (ClearRegs[
D * 2 + 1]) {
1341 unsigned Reg = ARM::S0 +
D * 2 + 1;
1371ARMExpandPseudo::CMSEClearFPRegsV81(MachineBasicBlock &
MBB,
1373 const BitVector &ClearRegs) {
1379 for (
int S = 0,
E = ClearRegs.
size(); S !=
E; ++S) {
1380 if (ClearRegs[S] && S ==
End + 1) {
1386 MachineInstrBuilder VSCCLRM =
1389 while (++Start <=
End)
1390 VSCCLRM.
addReg(ARM::S0 + Start, RegState::Define);
1391 VSCCLRM.
addReg(ARM::VPR, RegState::Define);
1397 MachineInstrBuilder VSCCLRM =
1400 while (++Start <=
End)
1401 VSCCLRM.
addReg(ARM::S0 + Start, RegState::Define);
1402 VSCCLRM.
addReg(ARM::VPR, RegState::Define);
1408void ARMExpandPseudo::CMSESaveClearFPRegs(
1410 const LivePhysRegs &LiveRegs, SmallVectorImpl<Register> &ScratchRegs) {
1411 if (STI->hasV8_1MMainlineOps())
1412 CMSESaveClearFPRegsV81(
MBB,
MBBI,
DL, LiveRegs);
1413 else if (STI->hasV8MMainlineOps())
1414 CMSESaveClearFPRegsV8(
MBB,
MBBI,
DL, LiveRegs, ScratchRegs);
1418void ARMExpandPseudo::CMSESaveClearFPRegsV8(
1420 const LivePhysRegs &LiveRegs, SmallVectorImpl<Register> &ScratchRegs) {
1433 std::vector<std::tuple<Register, Register, Register>> ClearedFPRegs;
1434 std::vector<Register> NonclearedFPRegs;
1435 bool ReturnsFPReg =
false;
1436 for (
const MachineOperand &
Op :
MBBI->operands()) {
1437 if (
Op.isReg() &&
Op.isUse()) {
1443 if (ScratchRegs.
size() >= 2) {
1446 ClearedFPRegs.emplace_back(
Reg, SaveReg1, SaveReg2);
1450 .
addReg(SaveReg1, RegState::Define)
1451 .
addReg(SaveReg2, RegState::Define)
1455 NonclearedFPRegs.push_back(
Reg);
1458 if (ScratchRegs.
size() >= 1) {
1460 ClearedFPRegs.emplace_back(
Reg, SaveReg,
Register());
1467 NonclearedFPRegs.push_back(
Reg);
1470 }
else if (
Op.isReg() &&
Op.isDef()) {
1474 ReturnsFPReg =
true;
1478 bool PassesFPReg = (!NonclearedFPRegs.empty() || !ClearedFPRegs.empty());
1480 if (PassesFPReg || ReturnsFPReg)
1481 assert(STI->hasFPRegs() &&
"Subtarget needs fpregs");
1507 if (ReturnsFPReg && !PassesFPReg) {
1508 bool S0Dead = !LiveRegs.contains(ARM::S0);
1517 MachineInstrBuilder VLSTM =
1532 for (
const auto &Regs : ClearedFPRegs) {
1534 std::tie(
Reg, SaveReg1, SaveReg2) = Regs;
1556 MCRegister SReg0 =
TRI->getSubReg(
Reg, ARM::ssub_0);
1599void ARMExpandPseudo::CMSESaveClearFPRegsV81(MachineBasicBlock &
MBB,
1602 const LivePhysRegs &LiveRegs) {
1603 BitVector ClearRegs(32,
true);
1609 if (!DefFP && ClearRegs.
count() == ClearRegs.
size()) {
1617 MachineInstrBuilder VLSTM =
1632 MachineInstrBuilder VPUSH =
1640 (void)CMSEClearFPRegsV81(
MBB,
MBBI, ClearRegs);
1651void ARMExpandPseudo::CMSERestoreFPRegs(
1653 SmallVectorImpl<Register> &AvailableRegs) {
1654 if (STI->hasV8_1MMainlineOps())
1655 CMSERestoreFPRegsV81(
MBB,
MBBI,
DL, AvailableRegs);
1656 else if (STI->hasV8MMainlineOps())
1657 CMSERestoreFPRegsV8(
MBB,
MBBI,
DL, AvailableRegs);
1660void ARMExpandPseudo::CMSERestoreFPRegsV8(
1662 SmallVectorImpl<Register> &AvailableRegs) {
1666 if (STI->fixCMSE_CVE_2021_35465())
1670 std::vector<std::tuple<Register, Register, Register>> ClearedFPRegs;
1671 std::vector<Register> NonclearedFPRegs;
1672 for (
const MachineOperand &
Op :
MBBI->operands()) {
1673 if (
Op.isReg() &&
Op.isDef()) {
1679 if (AvailableRegs.
size() >= 2) {
1682 ClearedFPRegs.emplace_back(
Reg, SaveReg1, SaveReg2);
1686 .
addReg(SaveReg1, RegState::Define)
1687 .
addReg(SaveReg2, RegState::Define)
1691 NonclearedFPRegs.push_back(
Reg);
1694 if (AvailableRegs.
size() >= 1) {
1696 ClearedFPRegs.emplace_back(
Reg, SaveReg, 0);
1703 NonclearedFPRegs.push_back(
Reg);
1709 bool returnsFPReg = (!NonclearedFPRegs.empty() || !ClearedFPRegs.empty());
1712 assert(STI->hasFPRegs() &&
"Subtarget needs fpregs");
1732 MachineInstrBuilder VLLDM =
1739 if (STI->fixCMSE_CVE_2021_35465()) {
1740 auto Bundler = MIBundleBuilder(
MBB, VLLDM);
1743 .
addReg(ScratchReg, RegState::Define)
1759 if (STI->hasFPRegs())
1761 .
addReg(ARM::S0, RegState::Define)
1762 .
addReg(ARM::S0, RegState::Undef)
1772 for (
const auto &Regs : ClearedFPRegs) {
1774 std::tie(
Reg, SaveReg1, SaveReg2) = Regs;
1798 if ((
Reg >= ARM::Q0 &&
Reg <= ARM::Q7) ||
1799 (
Reg >= ARM::D0 &&
Reg <= ARM::D15) ||
1800 (
Reg >= ARM::S0 &&
Reg <= ARM::S31))
1806void ARMExpandPseudo::CMSERestoreFPRegsV81(
1808 SmallVectorImpl<Register> & ) {
1810 if (STI->fixCMSE_CVE_2021_35465()) {
1813 .
addReg(ARM::VPR, RegState::Define);
1837 MachineInstrBuilder VPOP =
1852 return ARM::tCMPhir;
1858bool ARMExpandPseudo::ExpandCMP_SWAP(MachineBasicBlock &
MBB,
1860 unsigned LdrexOp,
unsigned StrexOp,
1863 bool IsThumb = STI->isThumb();
1865 MachineInstr &
MI = *
MBBI;
1867 const MachineOperand &Dest =
MI.getOperand(0);
1868 Register TempReg =
MI.getOperand(1).getReg();
1871 assert(!
MI.getOperand(2).isUndef() &&
"cannot handle undef");
1872 Register AddrReg =
MI.getOperand(2).getReg();
1873 Register DesiredReg =
MI.getOperand(3).getReg();
1877 assert(STI->hasV8MBaselineOps() &&
1878 "CMP_SWAP not expected to be custom expanded for Thumb1");
1879 assert((UxtOp == 0 || UxtOp == ARM::tUXTB || UxtOp == ARM::tUXTH) &&
1880 "ARMv8-M.baseline does not have t2UXTB/t2UXTH");
1882 "DesiredReg used for UXT op must be tGPR");
1891 MF->
insert(++LoadCmpBB->getIterator(), StoreBB);
1892 MF->
insert(++StoreBB->getIterator(), DoneBB);
1895 MachineInstrBuilder MIB =
1897 .
addReg(DesiredReg, RegState::Kill);
1908 MachineInstrBuilder MIB;
1911 if (LdrexOp == ARM::t2LDREX)
1920 unsigned Bcc = IsThumb ? ARM::tBcc : ARM::Bcc;
1924 .
addReg(ARM::CPSR, RegState::Kill);
1925 LoadCmpBB->addSuccessor(DoneBB);
1926 LoadCmpBB->addSuccessor(StoreBB);
1935 if (StrexOp == ARM::t2STREX)
1940 IsThumb ? (IsThumb1Only ? ARM::tCMPi8 : ARM::t2CMPri) :
ARM::CMPri;
1942 .
addReg(TempReg, RegState::Kill)
1948 .
addReg(ARM::CPSR, RegState::Kill);
1949 StoreBB->addSuccessor(LoadCmpBB);
1950 StoreBB->addSuccessor(DoneBB);
1958 MI.eraseFromParent();
1961 LivePhysRegs LiveRegs;
1966 StoreBB->clearLiveIns();
1968 LoadCmpBB->clearLiveIns();
1983 MIB.
addReg(RegLo, Flags);
1984 MIB.
addReg(RegHi, Flags);
1990bool ARMExpandPseudo::ExpandCMP_SWAP_64(MachineBasicBlock &
MBB,
1993 bool IsThumb = STI->isThumb();
1995 MachineInstr &
MI = *
MBBI;
1997 MachineOperand &Dest =
MI.getOperand(0);
2000 assert(!
MI.getOperand(1).isUndef() &&
"cannot handle undef");
2001 Register AddrAndTempReg =
MI.getOperand(1).getReg();
2002 Register AddrReg =
TRI->getSubReg(AddrAndTempReg, ARM::gsub_0);
2003 Register TempReg =
TRI->getSubReg(AddrAndTempReg, ARM::gsub_1);
2004 assert(
MI.getOperand(1).getReg() ==
MI.getOperand(2).getReg() &&
2005 "tied operands have different registers");
2006 Register DesiredReg =
MI.getOperand(3).getReg();
2007 MachineOperand
New =
MI.getOperand(4);
2008 New.setIsKill(
false);
2012 Register DesiredLo =
TRI->getSubReg(DesiredReg, ARM::gsub_0);
2013 Register DesiredHi =
TRI->getSubReg(DesiredReg, ARM::gsub_1);
2021 MF->
insert(++LoadCmpBB->getIterator(), StoreBB);
2022 MF->
insert(++StoreBB->getIterator(), DoneBB);
2029 unsigned LDREXD = IsThumb ? ARM::t2LDREXD : ARM::LDREXD;
2030 MachineInstrBuilder MIB;
2035 unsigned CMPrrLo =
getCmpOpcode(IsThumb, DestLo, DesiredLo);
2041 unsigned CMPrrHi =
getCmpOpcode(IsThumb, DestHi, DesiredHi);
2046 .
addReg(ARM::CPSR, RegState::Kill);
2048 unsigned Bcc = IsThumb ? ARM::tBcc : ARM::Bcc;
2052 .
addReg(ARM::CPSR, RegState::Kill);
2053 LoadCmpBB->addSuccessor(DoneBB);
2054 LoadCmpBB->addSuccessor(StoreBB);
2060 unsigned STREXD = IsThumb ? ARM::t2STREXD : ARM::STREXD;
2066 unsigned CMPri = IsThumb ? ARM::t2CMPri : ARM::CMPri;
2068 .
addReg(TempReg, RegState::Kill)
2074 .
addReg(ARM::CPSR, RegState::Kill);
2075 StoreBB->addSuccessor(LoadCmpBB);
2076 StoreBB->addSuccessor(DoneBB);
2084 MI.eraseFromParent();
2087 LivePhysRegs LiveRegs;
2092 StoreBB->clearLiveIns();
2094 LoadCmpBB->clearLiveIns();
2121 const Register LoRegs[] = {ARM::R7, ARM::R6, ARM::R5, ARM::R4};
2122 const Register HiRegs[] = {ARM::R11, ARM::R10, ARM::R9, ARM::R8};
2125 if (JumpReg == LoReg)
2144 if (JumpReg >= ARM::R4 && JumpReg <= ARM::R7) {
2145 Register LoReg = JumpReg == ARM::R4 ? ARM::R5 : ARM::R4;
2173 for (
int R = 0; R < 4; ++R) {
2181 for (
int R = 0; R < 4; ++R)
2193bool ARMExpandPseudo::ExpandMI(MachineBasicBlock &
MBB,
2196 MachineInstr &
MI = *
MBBI;
2197 unsigned Opcode =
MI.getOpcode();
2205 if (DstReg ==
MI.getOperand(3).getReg()) {
2207 unsigned NewOpc = Opcode == ARM::VBSPd ? ARM::VBITd : ARM::VBITq;
2209 .
add(
MI.getOperand(0))
2210 .
add(
MI.getOperand(3))
2211 .
add(
MI.getOperand(2))
2212 .
add(
MI.getOperand(1))
2214 .
add(
MI.getOperand(5));
2215 }
else if (DstReg ==
MI.getOperand(2).getReg()) {
2217 unsigned NewOpc = Opcode == ARM::VBSPd ? ARM::VBIFd : ARM::VBIFq;
2219 .
add(
MI.getOperand(0))
2220 .
add(
MI.getOperand(2))
2221 .
add(
MI.getOperand(3))
2222 .
add(
MI.getOperand(1))
2224 .
add(
MI.getOperand(5));
2227 unsigned NewOpc = Opcode == ARM::VBSPd ? ARM::VBSLd : ARM::VBSLq;
2228 if (DstReg ==
MI.getOperand(1).getReg()) {
2230 .
add(
MI.getOperand(0))
2231 .
add(
MI.getOperand(1))
2232 .
add(
MI.getOperand(2))
2233 .
add(
MI.getOperand(3))
2235 .
add(
MI.getOperand(5));
2238 unsigned MoveOpc = Opcode == ARM::VBSPd ? ARM::VORRd : ARM::VORRq;
2244 .
addReg(
MI.getOperand(1).getReg(), MO1Flags)
2245 .
addReg(
MI.getOperand(1).getReg(), MO1Flags)
2247 .
add(
MI.getOperand(5));
2249 .
add(
MI.getOperand(0))
2253 .
add(
MI.getOperand(2))
2254 .
add(
MI.getOperand(3))
2256 .
add(
MI.getOperand(5));
2259 MI.eraseFromParent();
2263 case ARM::CLEANUPRET:
2264 case ARM::CATCHRET: {
2265 unsigned RetOpcode = STI->isThumb() ? ARM::tBX_RET : ARM::BX_RET;
2268 MI.eraseFromParent();
2271 case ARM::TCRETURNdi:
2272 case ARM::TCRETURNri:
2273 case ARM::TCRETURNrinotr12: {
2275 if (
MBBI->getOpcode() == ARM::SEH_EpilogEnd)
2277 if (
MBBI->getOpcode() == ARM::SEH_Nop_Ret)
2280 "Can only insert epilog into returning blocks");
2281 unsigned RetOpcode =
MBBI->getOpcode();
2283 const ARMBaseInstrInfo &
TII = *
static_cast<const ARMBaseInstrInfo *
>(
2288 if (
MBBI->getOpcode() == ARM::SEH_EpilogEnd)
2290 if (
MBBI->getOpcode() == ARM::SEH_Nop_Ret)
2292 MachineOperand &JumpTarget =
MBBI->getOperand(0);
2295 if (RetOpcode == ARM::TCRETURNdi) {
2316 }
else if (RetOpcode == ARM::TCRETURNri ||
2317 RetOpcode == ARM::TCRETURNrinotr12) {
2319 STI->isThumb() ? ARM::tTAILJMPr
2320 : (STI->hasV4TOps() ? ARM::TAILJMPr : ARM::TAILJMPr4);
2326 auto NewMI = std::prev(
MBBI);
2327 for (
unsigned i = 2, e =
MBBI->getNumOperands(); i != e; ++i)
2328 NewMI->addOperand(
MBBI->getOperand(i));
2333 if (
MI.isCandidateForAdditionalCallInfo())
2334 MI.getMF()->moveAdditionalCallInfo(&
MI, &*NewMI);
2343 case ARM::tBXNS_RET: {
2349 MachineBasicBlock &AfterBB = CMSEClearFPRegs(
MBB,
MBBI);
2351 if (STI->hasV8_1MMainlineOps()) {
2354 TII->get(ARM::VLDR_FPCXTNS_post), ARM::SP)
2365 return !Op.isReg() || Op.getReg() != ARM::R12;
2369 *
MBBI, {ARM::R0, ARM::R1, ARM::R2, ARM::R3, ARM::R12}, ClearRegs);
2370 CMSEClearGPRegs(AfterBB, AfterBB.
end(),
MBBI->getDebugLoc(), ClearRegs,
2373 MachineInstrBuilder NewMI =
2375 TII->get(ARM::tBXNS))
2378 for (
const MachineOperand &
Op :
MI.operands())
2380 MI.eraseFromParent();
2383 case ARM::tBLXNS_CALL: {
2391 LivePhysRegs LiveRegs(*
TRI);
2392 LiveRegs.addLiveOuts(
MBB);
2394 LiveRegs.stepBackward(
MI);
2395 LiveRegs.stepBackward(*
MBBI);
2400 SmallVector<Register, 16> ClearRegs;
2402 {ARM::R0, ARM::R1, ARM::R2, ARM::R3, ARM::R4,
2403 ARM::R5, ARM::R6, ARM::R7, ARM::R8, ARM::R9,
2404 ARM::R10, ARM::R11, ARM::R12},
2406 auto OriginalClearRegs = ClearRegs;
2428 .
addReg(ARM::CPSR, RegState::Define)
2434 CMSESaveClearFPRegs(
MBB,
MBBI,
DL, LiveRegs,
2436 CMSEClearGPRegs(
MBB,
MBBI,
DL, ClearRegs, JumpReg);
2441 MachineInstr *NewCall = MF.CreateMachineInstr(
TII->get(ARM::tBLXNSr),
DL,
2444 MachineInstrBuilder(MF, NewCall)
2446 .addReg(JumpReg, RegState::Kill);
2450 if (
MI.isCandidateForAdditionalCallInfo())
2451 MI.getMF()->moveAdditionalCallInfo(&
MI, NewCall);
2453 CMSERestoreFPRegs(
MBB,
MBBI,
DL, OriginalClearRegs);
2457 MI.eraseFromParent();
2462 case ARM::VMOVDcc: {
2463 unsigned newOpc = Opcode != ARM::VMOVDcc ? ARM::VMOVS : ARM::VMOVD;
2465 MI.getOperand(1).getReg())
2466 .
add(
MI.getOperand(2))
2468 .
add(
MI.getOperand(4))
2471 MI.eraseFromParent();
2478 MI.getOperand(1).getReg())
2479 .
add(
MI.getOperand(2))
2481 .
add(
MI.getOperand(4))
2485 MI.eraseFromParent();
2488 case ARM::MOVCCsi: {
2490 (
MI.getOperand(1).getReg()))
2491 .
add(
MI.getOperand(2))
2494 .
add(
MI.getOperand(5))
2498 MI.eraseFromParent();
2501 case ARM::MOVCCsr: {
2503 (
MI.getOperand(1).getReg()))
2504 .
add(
MI.getOperand(2))
2505 .
add(
MI.getOperand(3))
2508 .
add(
MI.getOperand(6))
2512 MI.eraseFromParent();
2515 case ARM::t2MOVCCi16:
2516 case ARM::MOVCCi16: {
2517 unsigned NewOpc = AFI->
isThumbFunction() ? ARM::t2MOVi16 : ARM::MOVi16;
2519 MI.getOperand(1).getReg())
2522 .
add(
MI.getOperand(4))
2524 MI.eraseFromParent();
2531 MI.getOperand(1).getReg())
2534 .
add(
MI.getOperand(4))
2538 MI.eraseFromParent();
2545 MI.getOperand(1).getReg())
2548 .
add(
MI.getOperand(4))
2552 MI.eraseFromParent();
2555 case ARM::t2MOVCClsl:
2556 case ARM::t2MOVCClsr:
2557 case ARM::t2MOVCCasr:
2558 case ARM::t2MOVCCror: {
2561 case ARM::t2MOVCClsl: NewOpc = ARM::t2LSLri;
break;
2562 case ARM::t2MOVCClsr: NewOpc = ARM::t2LSRri;
break;
2563 case ARM::t2MOVCCasr: NewOpc = ARM::t2ASRri;
break;
2564 case ARM::t2MOVCCror: NewOpc = ARM::t2RORri;
break;
2568 MI.getOperand(1).getReg())
2569 .
add(
MI.getOperand(2))
2572 .
add(
MI.getOperand(5))
2575 MI.eraseFromParent();
2578 case ARM::Int_eh_sjlj_dispatchsetup: {
2588 "base pointer without frame pointer?");
2602 if (RI.hasStackRealignment(MF)) {
2608 "The BIC instruction cannot encode "
2609 "immediates larger than 256 with all lower "
2612 ARM::t2BICri : ARM::BICri;
2614 .
addReg(ARM::R6, RegState::Kill)
2620 MI.eraseFromParent();
2628 MI.getOperand(0).getReg())
2629 .
add(
MI.getOperand(1))
2633 .
addReg(ARM::CPSR, RegState::Define);
2634 MI.eraseFromParent();
2640 MI.getOperand(0).getReg())
2641 .
add(
MI.getOperand(1))
2646 MI.eraseFromParent();
2651 const bool Thumb = Opcode == ARM::tTPsoft;
2653 MachineInstrBuilder MIB;
2655 if (STI->genLongCalls()) {
2658 MachineConstantPoolValue *CPV =
2660 "__aeabi_read_tp", PCLabelID, 0);
2664 TII->get(Thumb ? ARM::tLDRpci : ARM::LDRi12),
Reg)
2673 MachineInstr *
Call = MF->CreateMachineInstr(
2674 TII->get(CallOpc),
MI.getDebugLoc(),
true);
2676 MIB = MachineInstrBuilder(*MF,
Call);
2681 unsigned CallOpc =
Thumb ? ARM::tBL : ARM::BL;
2682 MachineInstr *
Call = MF->CreateMachineInstr(
2683 TII->get(CallOpc),
MI.getDebugLoc(),
true);
2685 MIB = MachineInstrBuilder(*MF,
Call);
2692 for (
const MachineOperand &MO :
MI.operands())
2695 if (
MI.isCandidateForAdditionalCallInfo())
2697 MI.eraseFromParent();
2700 case ARM::tLDRpci_pic:
2701 case ARM::t2LDRpci_pic: {
2702 unsigned NewLdOpc = (Opcode == ARM::tLDRpci_pic)
2703 ? ARM::tLDRpci :
ARM::t2LDRpci;
2705 bool DstIsDead =
MI.getOperand(0).isDead();
2707 .
add(
MI.getOperand(1))
2714 .
add(
MI.getOperand(2))
2716 MI.eraseFromParent();
2720 case ARM::LDRLIT_ga_abs:
2721 case ARM::LDRLIT_ga_pcrel:
2722 case ARM::LDRLIT_ga_pcrel_ldr:
2723 case ARM::tLDRLIT_ga_abs:
2724 case ARM::t2LDRLIT_ga_pcrel:
2725 case ARM::tLDRLIT_ga_pcrel: {
2727 bool DstIsDead =
MI.getOperand(0).isDead();
2728 const MachineOperand &MO1 =
MI.getOperand(1);
2730 const GlobalValue *GV = MO1.
getGlobal();
2731 bool IsARM = Opcode != ARM::tLDRLIT_ga_pcrel &&
2732 Opcode != ARM::tLDRLIT_ga_abs &&
2733 Opcode != ARM::t2LDRLIT_ga_pcrel;
2735 Opcode != ARM::LDRLIT_ga_abs && Opcode != ARM::tLDRLIT_ga_abs;
2736 unsigned LDRLITOpc = IsARM ? ARM::LDRi12 : ARM::tLDRpci;
2737 if (Opcode == ARM::t2LDRLIT_ga_pcrel)
2738 LDRLITOpc = ARM::t2LDRpci;
2739 unsigned PICAddOpc =
2741 ? (Opcode == ARM::LDRLIT_ga_pcrel_ldr ? ARM::PICLDR : ARM::PICADD)
2746 unsigned ARMPCLabelIndex = 0;
2747 MachineConstantPoolValue *CPV;
2750 unsigned PCAdj = IsARM ? 8 : 4;
2761 MachineInstrBuilder MIB =
2769 MachineInstrBuilder MIB =
2773 .
addImm(ARMPCLabelIndex);
2779 MI.eraseFromParent();
2782 case ARM::MOV_ga_pcrel:
2783 case ARM::MOV_ga_pcrel_ldr:
2784 case ARM::t2MOV_ga_pcrel: {
2788 bool DstIsDead =
MI.getOperand(0).isDead();
2789 const MachineOperand &MO1 =
MI.getOperand(1);
2790 const GlobalValue *GV = MO1.
getGlobal();
2792 bool isARM = Opcode != ARM::t2MOV_ga_pcrel;
2793 unsigned LO16Opc = isARM ? ARM::MOVi16_ga_pcrel : ARM::t2MOVi16_ga_pcrel;
2794 unsigned HI16Opc = isARM ? ARM::MOVTi16_ga_pcrel :ARM::t2MOVTi16_ga_pcrel;
2797 unsigned PICAddOpc = isARM
2798 ? (Opcode == ARM::MOV_ga_pcrel_ldr ? ARM::PICLDR : ARM::PICADD)
2812 TII->get(PICAddOpc))
2817 if (Opcode == ARM::MOV_ga_pcrel_ldr)
2821 MI.eraseFromParent();
2825 case ARM::MOVi32imm:
2826 case ARM::MOVCCi32imm:
2827 case ARM::t2MOVi32imm:
2828 case ARM::t2MOVCCi32imm:
2832 case ARM::tMOVi32imm:
2833 ExpandTMOV32BitImm(
MBB,
MBBI);
2836 case ARM::tLEApcrelJT:
2838 if (
MI.getMF()->getJumpTableInfo()->getEntryKind() ==
2843 assert(STI->isThumb() &&
"Non-inline jump tables expected only in thumb");
2844 ExpandTMOV32BitImm(
MBB,
MBBI);
2847 case ARM::SUBS_PC_LR: {
2850 .
add(
MI.getOperand(0))
2851 .
add(
MI.getOperand(1))
2852 .
add(
MI.getOperand(2))
2853 .
addReg(ARM::CPSR, RegState::Undef)
2855 MI.eraseFromParent();
2858 case ARM::VLDMQIA: {
2859 unsigned NewOpc = ARM::VLDMDIA;
2860 MachineInstrBuilder MIB =
2865 bool DstIsDead =
MI.getOperand(OpIdx).isDead();
2866 Register DstReg =
MI.getOperand(OpIdx++).getReg();
2869 MIB.
add(
MI.getOperand(OpIdx++));
2872 MIB.
add(
MI.getOperand(OpIdx++));
2873 MIB.
add(
MI.getOperand(OpIdx++));
2876 Register D0 =
TRI->getSubReg(DstReg, ARM::dsub_0);
2877 Register D1 =
TRI->getSubReg(DstReg, ARM::dsub_1);
2885 MI.eraseFromParent();
2889 case ARM::VSTMQIA: {
2890 unsigned NewOpc = ARM::VSTMDIA;
2891 MachineInstrBuilder MIB =
2896 bool SrcIsKill =
MI.getOperand(OpIdx).isKill();
2897 Register SrcReg =
MI.getOperand(OpIdx++).getReg();
2900 MachineOperand Dst(
MI.getOperand(OpIdx++));
2904 MIB.
add(
MI.getOperand(OpIdx++));
2905 MIB.
add(
MI.getOperand(OpIdx++));
2908 Register D0 =
TRI->getSubReg(SrcReg, ARM::dsub_0);
2909 Register D1 =
TRI->getSubReg(SrcReg, ARM::dsub_1);
2918 MI.eraseFromParent();
2922 case ARM::VLD2q8Pseudo:
2923 case ARM::VLD2q16Pseudo:
2924 case ARM::VLD2q32Pseudo:
2925 case ARM::VLD2q8PseudoWB_fixed:
2926 case ARM::VLD2q16PseudoWB_fixed:
2927 case ARM::VLD2q32PseudoWB_fixed:
2928 case ARM::VLD2q8PseudoWB_register:
2929 case ARM::VLD2q16PseudoWB_register:
2930 case ARM::VLD2q32PseudoWB_register:
2931 case ARM::VLD3d8Pseudo:
2932 case ARM::VLD3d16Pseudo:
2933 case ARM::VLD3d32Pseudo:
2934 case ARM::VLD1d8TPseudo:
2935 case ARM::VLD1d8TPseudoWB_fixed:
2936 case ARM::VLD1d8TPseudoWB_register:
2937 case ARM::VLD1d16TPseudo:
2938 case ARM::VLD1d16TPseudoWB_fixed:
2939 case ARM::VLD1d16TPseudoWB_register:
2940 case ARM::VLD1d32TPseudo:
2941 case ARM::VLD1d32TPseudoWB_fixed:
2942 case ARM::VLD1d32TPseudoWB_register:
2943 case ARM::VLD1d64TPseudo:
2944 case ARM::VLD1d64TPseudoWB_fixed:
2945 case ARM::VLD1d64TPseudoWB_register:
2946 case ARM::VLD3d8Pseudo_UPD:
2947 case ARM::VLD3d16Pseudo_UPD:
2948 case ARM::VLD3d32Pseudo_UPD:
2949 case ARM::VLD3q8Pseudo_UPD:
2950 case ARM::VLD3q16Pseudo_UPD:
2951 case ARM::VLD3q32Pseudo_UPD:
2952 case ARM::VLD3q8oddPseudo:
2953 case ARM::VLD3q16oddPseudo:
2954 case ARM::VLD3q32oddPseudo:
2955 case ARM::VLD3q8oddPseudo_UPD:
2956 case ARM::VLD3q16oddPseudo_UPD:
2957 case ARM::VLD3q32oddPseudo_UPD:
2958 case ARM::VLD4d8Pseudo:
2959 case ARM::VLD4d16Pseudo:
2960 case ARM::VLD4d32Pseudo:
2961 case ARM::VLD1d8QPseudo:
2962 case ARM::VLD1d8QPseudoWB_fixed:
2963 case ARM::VLD1d8QPseudoWB_register:
2964 case ARM::VLD1d16QPseudo:
2965 case ARM::VLD1d16QPseudoWB_fixed:
2966 case ARM::VLD1d16QPseudoWB_register:
2967 case ARM::VLD1d32QPseudo:
2968 case ARM::VLD1d32QPseudoWB_fixed:
2969 case ARM::VLD1d32QPseudoWB_register:
2970 case ARM::VLD1d64QPseudo:
2971 case ARM::VLD1d64QPseudoWB_fixed:
2972 case ARM::VLD1d64QPseudoWB_register:
2973 case ARM::VLD1q8HighQPseudo:
2974 case ARM::VLD1q8HighQPseudo_UPD:
2975 case ARM::VLD1q8LowQPseudo_UPD:
2976 case ARM::VLD1q8HighTPseudo:
2977 case ARM::VLD1q8HighTPseudo_UPD:
2978 case ARM::VLD1q8LowTPseudo_UPD:
2979 case ARM::VLD1q16HighQPseudo:
2980 case ARM::VLD1q16HighQPseudo_UPD:
2981 case ARM::VLD1q16LowQPseudo_UPD:
2982 case ARM::VLD1q16HighTPseudo:
2983 case ARM::VLD1q16HighTPseudo_UPD:
2984 case ARM::VLD1q16LowTPseudo_UPD:
2985 case ARM::VLD1q32HighQPseudo:
2986 case ARM::VLD1q32HighQPseudo_UPD:
2987 case ARM::VLD1q32LowQPseudo_UPD:
2988 case ARM::VLD1q32HighTPseudo:
2989 case ARM::VLD1q32HighTPseudo_UPD:
2990 case ARM::VLD1q32LowTPseudo_UPD:
2991 case ARM::VLD1q64HighQPseudo:
2992 case ARM::VLD1q64HighQPseudo_UPD:
2993 case ARM::VLD1q64LowQPseudo_UPD:
2994 case ARM::VLD1q64HighTPseudo:
2995 case ARM::VLD1q64HighTPseudo_UPD:
2996 case ARM::VLD1q64LowTPseudo_UPD:
2997 case ARM::VLD4d8Pseudo_UPD:
2998 case ARM::VLD4d16Pseudo_UPD:
2999 case ARM::VLD4d32Pseudo_UPD:
3000 case ARM::VLD4q8Pseudo_UPD:
3001 case ARM::VLD4q16Pseudo_UPD:
3002 case ARM::VLD4q32Pseudo_UPD:
3003 case ARM::VLD4q8oddPseudo:
3004 case ARM::VLD4q16oddPseudo:
3005 case ARM::VLD4q32oddPseudo:
3006 case ARM::VLD4q8oddPseudo_UPD:
3007 case ARM::VLD4q16oddPseudo_UPD:
3008 case ARM::VLD4q32oddPseudo_UPD:
3009 case ARM::VLD3DUPd8Pseudo:
3010 case ARM::VLD3DUPd16Pseudo:
3011 case ARM::VLD3DUPd32Pseudo:
3012 case ARM::VLD3DUPd8Pseudo_UPD:
3013 case ARM::VLD3DUPd16Pseudo_UPD:
3014 case ARM::VLD3DUPd32Pseudo_UPD:
3015 case ARM::VLD4DUPd8Pseudo:
3016 case ARM::VLD4DUPd16Pseudo:
3017 case ARM::VLD4DUPd32Pseudo:
3018 case ARM::VLD4DUPd8Pseudo_UPD:
3019 case ARM::VLD4DUPd16Pseudo_UPD:
3020 case ARM::VLD4DUPd32Pseudo_UPD:
3021 case ARM::VLD2DUPq8EvenPseudo:
3022 case ARM::VLD2DUPq8OddPseudo:
3023 case ARM::VLD2DUPq16EvenPseudo:
3024 case ARM::VLD2DUPq16OddPseudo:
3025 case ARM::VLD2DUPq32EvenPseudo:
3026 case ARM::VLD2DUPq32OddPseudo:
3027 case ARM::VLD2DUPq8OddPseudoWB_fixed:
3028 case ARM::VLD2DUPq8OddPseudoWB_register:
3029 case ARM::VLD2DUPq16OddPseudoWB_fixed:
3030 case ARM::VLD2DUPq16OddPseudoWB_register:
3031 case ARM::VLD2DUPq32OddPseudoWB_fixed:
3032 case ARM::VLD2DUPq32OddPseudoWB_register:
3033 case ARM::VLD3DUPq8EvenPseudo:
3034 case ARM::VLD3DUPq8OddPseudo:
3035 case ARM::VLD3DUPq16EvenPseudo:
3036 case ARM::VLD3DUPq16OddPseudo:
3037 case ARM::VLD3DUPq32EvenPseudo:
3038 case ARM::VLD3DUPq32OddPseudo:
3039 case ARM::VLD3DUPq8OddPseudo_UPD:
3040 case ARM::VLD3DUPq16OddPseudo_UPD:
3041 case ARM::VLD3DUPq32OddPseudo_UPD:
3042 case ARM::VLD4DUPq8EvenPseudo:
3043 case ARM::VLD4DUPq8OddPseudo:
3044 case ARM::VLD4DUPq16EvenPseudo:
3045 case ARM::VLD4DUPq16OddPseudo:
3046 case ARM::VLD4DUPq32EvenPseudo:
3047 case ARM::VLD4DUPq32OddPseudo:
3048 case ARM::VLD4DUPq8OddPseudo_UPD:
3049 case ARM::VLD4DUPq16OddPseudo_UPD:
3050 case ARM::VLD4DUPq32OddPseudo_UPD:
3054 case ARM::VST2q8Pseudo:
3055 case ARM::VST2q16Pseudo:
3056 case ARM::VST2q32Pseudo:
3057 case ARM::VST2q8PseudoWB_fixed:
3058 case ARM::VST2q16PseudoWB_fixed:
3059 case ARM::VST2q32PseudoWB_fixed:
3060 case ARM::VST2q8PseudoWB_register:
3061 case ARM::VST2q16PseudoWB_register:
3062 case ARM::VST2q32PseudoWB_register:
3063 case ARM::VST3d8Pseudo:
3064 case ARM::VST3d16Pseudo:
3065 case ARM::VST3d32Pseudo:
3066 case ARM::VST1d8TPseudo:
3067 case ARM::VST1d8TPseudoWB_fixed:
3068 case ARM::VST1d8TPseudoWB_register:
3069 case ARM::VST1d16TPseudo:
3070 case ARM::VST1d16TPseudoWB_fixed:
3071 case ARM::VST1d16TPseudoWB_register:
3072 case ARM::VST1d32TPseudo:
3073 case ARM::VST1d32TPseudoWB_fixed:
3074 case ARM::VST1d32TPseudoWB_register:
3075 case ARM::VST1d64TPseudo:
3076 case ARM::VST1d64TPseudoWB_fixed:
3077 case ARM::VST1d64TPseudoWB_register:
3078 case ARM::VST3d8Pseudo_UPD:
3079 case ARM::VST3d16Pseudo_UPD:
3080 case ARM::VST3d32Pseudo_UPD:
3081 case ARM::VST3q8Pseudo_UPD:
3082 case ARM::VST3q16Pseudo_UPD:
3083 case ARM::VST3q32Pseudo_UPD:
3084 case ARM::VST3q8oddPseudo:
3085 case ARM::VST3q16oddPseudo:
3086 case ARM::VST3q32oddPseudo:
3087 case ARM::VST3q8oddPseudo_UPD:
3088 case ARM::VST3q16oddPseudo_UPD:
3089 case ARM::VST3q32oddPseudo_UPD:
3090 case ARM::VST4d8Pseudo:
3091 case ARM::VST4d16Pseudo:
3092 case ARM::VST4d32Pseudo:
3093 case ARM::VST1d8QPseudo:
3094 case ARM::VST1d8QPseudoWB_fixed:
3095 case ARM::VST1d8QPseudoWB_register:
3096 case ARM::VST1d16QPseudo:
3097 case ARM::VST1d16QPseudoWB_fixed:
3098 case ARM::VST1d16QPseudoWB_register:
3099 case ARM::VST1d32QPseudo:
3100 case ARM::VST1d32QPseudoWB_fixed:
3101 case ARM::VST1d32QPseudoWB_register:
3102 case ARM::VST1d64QPseudo:
3103 case ARM::VST1d64QPseudoWB_fixed:
3104 case ARM::VST1d64QPseudoWB_register:
3105 case ARM::VST4d8Pseudo_UPD:
3106 case ARM::VST4d16Pseudo_UPD:
3107 case ARM::VST4d32Pseudo_UPD:
3108 case ARM::VST1q8HighQPseudo:
3109 case ARM::VST1q8LowQPseudo_UPD:
3110 case ARM::VST1q8HighTPseudo:
3111 case ARM::VST1q8LowTPseudo_UPD:
3112 case ARM::VST1q16HighQPseudo:
3113 case ARM::VST1q16LowQPseudo_UPD:
3114 case ARM::VST1q16HighTPseudo:
3115 case ARM::VST1q16LowTPseudo_UPD:
3116 case ARM::VST1q32HighQPseudo:
3117 case ARM::VST1q32LowQPseudo_UPD:
3118 case ARM::VST1q32HighTPseudo:
3119 case ARM::VST1q32LowTPseudo_UPD:
3120 case ARM::VST1q64HighQPseudo:
3121 case ARM::VST1q64LowQPseudo_UPD:
3122 case ARM::VST1q64HighTPseudo:
3123 case ARM::VST1q64LowTPseudo_UPD:
3124 case ARM::VST1q8HighTPseudo_UPD:
3125 case ARM::VST1q16HighTPseudo_UPD:
3126 case ARM::VST1q32HighTPseudo_UPD:
3127 case ARM::VST1q64HighTPseudo_UPD:
3128 case ARM::VST1q8HighQPseudo_UPD:
3129 case ARM::VST1q16HighQPseudo_UPD:
3130 case ARM::VST1q32HighQPseudo_UPD:
3131 case ARM::VST1q64HighQPseudo_UPD:
3132 case ARM::VST4q8Pseudo_UPD:
3133 case ARM::VST4q16Pseudo_UPD:
3134 case ARM::VST4q32Pseudo_UPD:
3135 case ARM::VST4q8oddPseudo:
3136 case ARM::VST4q16oddPseudo:
3137 case ARM::VST4q32oddPseudo:
3138 case ARM::VST4q8oddPseudo_UPD:
3139 case ARM::VST4q16oddPseudo_UPD:
3140 case ARM::VST4q32oddPseudo_UPD:
3144 case ARM::VLD1LNq8Pseudo:
3145 case ARM::VLD1LNq16Pseudo:
3146 case ARM::VLD1LNq32Pseudo:
3147 case ARM::VLD1LNq8Pseudo_UPD:
3148 case ARM::VLD1LNq16Pseudo_UPD:
3149 case ARM::VLD1LNq32Pseudo_UPD:
3150 case ARM::VLD2LNd8Pseudo:
3151 case ARM::VLD2LNd16Pseudo:
3152 case ARM::VLD2LNd32Pseudo:
3153 case ARM::VLD2LNq16Pseudo:
3154 case ARM::VLD2LNq32Pseudo:
3155 case ARM::VLD2LNd8Pseudo_UPD:
3156 case ARM::VLD2LNd16Pseudo_UPD:
3157 case ARM::VLD2LNd32Pseudo_UPD:
3158 case ARM::VLD2LNq16Pseudo_UPD:
3159 case ARM::VLD2LNq32Pseudo_UPD:
3160 case ARM::VLD3LNd8Pseudo:
3161 case ARM::VLD3LNd16Pseudo:
3162 case ARM::VLD3LNd32Pseudo:
3163 case ARM::VLD3LNq16Pseudo:
3164 case ARM::VLD3LNq32Pseudo:
3165 case ARM::VLD3LNd8Pseudo_UPD:
3166 case ARM::VLD3LNd16Pseudo_UPD:
3167 case ARM::VLD3LNd32Pseudo_UPD:
3168 case ARM::VLD3LNq16Pseudo_UPD:
3169 case ARM::VLD3LNq32Pseudo_UPD:
3170 case ARM::VLD4LNd8Pseudo:
3171 case ARM::VLD4LNd16Pseudo:
3172 case ARM::VLD4LNd32Pseudo:
3173 case ARM::VLD4LNq16Pseudo:
3174 case ARM::VLD4LNq32Pseudo:
3175 case ARM::VLD4LNd8Pseudo_UPD:
3176 case ARM::VLD4LNd16Pseudo_UPD:
3177 case ARM::VLD4LNd32Pseudo_UPD:
3178 case ARM::VLD4LNq16Pseudo_UPD:
3179 case ARM::VLD4LNq32Pseudo_UPD:
3180 case ARM::VST1LNq8Pseudo:
3181 case ARM::VST1LNq16Pseudo:
3182 case ARM::VST1LNq32Pseudo:
3183 case ARM::VST1LNq8Pseudo_UPD:
3184 case ARM::VST1LNq16Pseudo_UPD:
3185 case ARM::VST1LNq32Pseudo_UPD:
3186 case ARM::VST2LNd8Pseudo:
3187 case ARM::VST2LNd16Pseudo:
3188 case ARM::VST2LNd32Pseudo:
3189 case ARM::VST2LNq16Pseudo:
3190 case ARM::VST2LNq32Pseudo:
3191 case ARM::VST2LNd8Pseudo_UPD:
3192 case ARM::VST2LNd16Pseudo_UPD:
3193 case ARM::VST2LNd32Pseudo_UPD:
3194 case ARM::VST2LNq16Pseudo_UPD:
3195 case ARM::VST2LNq32Pseudo_UPD:
3196 case ARM::VST3LNd8Pseudo:
3197 case ARM::VST3LNd16Pseudo:
3198 case ARM::VST3LNd32Pseudo:
3199 case ARM::VST3LNq16Pseudo:
3200 case ARM::VST3LNq32Pseudo:
3201 case ARM::VST3LNd8Pseudo_UPD:
3202 case ARM::VST3LNd16Pseudo_UPD:
3203 case ARM::VST3LNd32Pseudo_UPD:
3204 case ARM::VST3LNq16Pseudo_UPD:
3205 case ARM::VST3LNq32Pseudo_UPD:
3206 case ARM::VST4LNd8Pseudo:
3207 case ARM::VST4LNd16Pseudo:
3208 case ARM::VST4LNd32Pseudo:
3209 case ARM::VST4LNq16Pseudo:
3210 case ARM::VST4LNq32Pseudo:
3211 case ARM::VST4LNd8Pseudo_UPD:
3212 case ARM::VST4LNd16Pseudo_UPD:
3213 case ARM::VST4LNd32Pseudo_UPD:
3214 case ARM::VST4LNq16Pseudo_UPD:
3215 case ARM::VST4LNq32Pseudo_UPD:
3219 case ARM::VTBL3Pseudo: ExpandVTBL(
MBBI, ARM::VTBL3,
false);
return true;
3220 case ARM::VTBL4Pseudo: ExpandVTBL(
MBBI, ARM::VTBL4,
false);
return true;
3221 case ARM::VTBX3Pseudo: ExpandVTBL(
MBBI, ARM::VTBX3,
true);
return true;
3222 case ARM::VTBX4Pseudo: ExpandVTBL(
MBBI, ARM::VTBX4,
true);
return true;
3224 case ARM::MQQPRLoad:
3225 case ARM::MQQPRStore:
3226 case ARM::MQQQQPRLoad:
3227 case ARM::MQQQQPRStore:
3228 ExpandMQQPRLoadStore(
MBBI);
3231 case ARM::tCMP_SWAP_8:
3233 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::t2LDREXB, ARM::t2STREXB, ARM::tUXTB,
3235 case ARM::tCMP_SWAP_16:
3237 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::t2LDREXH, ARM::t2STREXH, ARM::tUXTH,
3239 case ARM::tCMP_SWAP_32:
3241 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::t2LDREX, ARM::t2STREX, 0, NextMBBI);
3243 case ARM::CMP_SWAP_8:
3245 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::LDREXB, ARM::STREXB, ARM::UXTB,
3247 case ARM::CMP_SWAP_16:
3249 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::LDREXH, ARM::STREXH, ARM::UXTH,
3251 case ARM::CMP_SWAP_32:
3253 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::LDREX, ARM::STREX, 0, NextMBBI);
3255 case ARM::CMP_SWAP_64:
3256 return ExpandCMP_SWAP_64(
MBB,
MBBI, NextMBBI);
3258 case ARM::tBL_PUSHLR:
3259 case ARM::BL_PUSHLR: {
3260 const bool Thumb = Opcode == ARM::tBL_PUSHLR;
3262 assert(
Reg == ARM::LR &&
"expect LR register!");
3264 unsigned CallOpc =
Thumb ? ARM::tBL : ARM::BL;
3273 .
addReg(ARM::SP, RegState::Define)
3281 MachineInstr *
Call =
3282 MF.CreateMachineInstr(
TII->get(CallOpc),
MI.getDebugLoc(),
3285 MachineInstrBuilder MIB(MF,
Call);
3289 MI.eraseFromParent();
3292 case ARM::t2CALL_BTI: {
3294 MI.setDesc(
TII->get(ARM::tBL));
3295 MIBundleBuilder Bundler(&
MI);
3296 Bundler.append(
BuildMI(MF,
MI.getDebugLoc(),
TII->get(ARM::t2BTI)));
3301 case ARM::STOREDUAL: {
3302 Register PairReg =
MI.getOperand(0).getReg();
3304 MachineInstrBuilder MIB =
3306 TII->get(Opcode == ARM::LOADDUAL ? ARM::LDRD : ARM::STRD))
3307 .
addReg(
TRI->getSubReg(PairReg, ARM::gsub_0),
3309 .
addReg(
TRI->getSubReg(PairReg, ARM::gsub_1),
3315 MI.eraseFromParent();
3321bool ARMExpandPseudo::ExpandMBB(MachineBasicBlock &
MBB) {
3338 AFI = MF.
getInfo<ARMFunctionInfo>();
3340 LLVM_DEBUG(
dbgs() <<
"********** ARM EXPAND PSEUDO INSTRUCTIONS **********\n"
3341 <<
"********** Function: " << MF.
getName() <<
'\n');
3344 for (MachineBasicBlock &
MBB : MF)
3346 if (STI->
getCLOpts().verify_arm_pseudo_expand)
3347 MF.verify(
this,
"After expanding ARM pseudo instructions.");
3349 LLVM_DEBUG(
dbgs() <<
"***************************************************\n");
3356 return new ARMExpandPseudo();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool determineFPRegsToClear(const MachineInstr &MI, BitVector &ClearRegs)
static void determineGPRegsToClear(const MachineInstr &MI, const std::initializer_list< unsigned > &Regs, SmallVectorImpl< Register > &ClearRegs)
static void CMSEPopCalleeSaves(const TargetInstrInfo &TII, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool Thumb1Only)
static void addExclusiveRegPair(MachineInstrBuilder &MIB, MachineOperand &Reg, RegState Flags, bool IsThumb, const TargetRegisterInfo *TRI)
ARM's ldrexd/strexd take a consecutive register pair (represented as a single GPRPair register),...
static unsigned getCmpOpcode(bool IsThumb, Register LHS, Register RHS)
static MachineOperand getMovOperand(const MachineOperand &MO, unsigned TargetFlag)
static MachineOperand makeImplicit(const MachineOperand &MO)
static void GetDSubRegs(Register Reg, NEONRegSpacing RegSpc, const TargetRegisterInfo *TRI, MCRegister &D0, MCRegister &D1, MCRegister &D2, MCRegister &D3)
GetDSubRegs - Get 4 D subregisters of a Q, QQ, or QQQQ register, corresponding to the specified regis...
static bool definesOrUsesFPReg(const MachineInstr &MI)
static void CMSEPushCalleeSaves(const TargetInstrInfo &TII, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register JumpReg, const LivePhysRegs &LiveRegs, bool Thumb1Only)
static bool IsAnAddressOperand(const MachineOperand &MO)
#define ARM_EXPAND_PSEUDO_NAME
static const int CMSE_FP_SAVE_SIZE
static const NEONLdStTableEntry * LookupNEONLdSt(unsigned Opcode)
LookupNEONLdSt - Search the NEONLdStTable for information about a NEON load or store pseudo instructi...
static const NEONLdStTableEntry NEONLdStTable[]
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const HexagonInstrInfo * TII
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
static const unsigned FramePtr
bool hasBasePointer(const MachineFunction &MF) const
Register getFrameRegister(const MachineFunction &MF) const override
static ARMConstantPoolConstant * Create(const Constant *C, unsigned ID)
static ARMConstantPoolSymbol * Create(LLVMContext &C, StringRef s, unsigned ID, unsigned char PCAdj, ARMCP::ARMCPModifier Modifier=ARMCP::no_modifier, bool AddCurrentAddress=false)
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
bool isThumb2Function() const
unsigned createPICLabelUId()
bool isThumb1OnlyFunction() const
bool isThumbFunction() const
bool shouldSignReturnAddress() const
unsigned getFramePtrSpillOffset() const
bool isTargetMachO() const
const ARMBaseInstrInfo * getInstrInfo() const override
bool isThumb1Only() const
bool isTargetWindows() const
const ARMBaseRegisterInfo * getRegisterInfo() const override
const ARMOptions & getCLOpts() const
Represent the analysis usage information of a pass.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
BitVector & reset()
Reset all bits in the bitvector.
size_type count() const
Returns the number of bits which are set.
size_type size() const
Returns the number of bits in this bitvector.
FunctionPass class - This class is used to implement most global optimizations.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
const HexagonRegisterInfo & getRegisterInfo() const
A set of physical registers with utility functions to track liveness when walking backward/forward th...
Wrapper class representing physical registers and target specific virtual registers.
LLVM_ABI void transferSuccessors(MachineBasicBlock *FromMBB)
Transfers all the successors from MBB to this machine basic block (i.e., copies all the successors Fr...
LLVM_ABI instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
LLVM_ABI void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
LLVM_ABI iterator getLastNonDebugInstr(bool SkipPseudoOp=true)
Returns an iterator to the last non-debug instruction in the basic block, or end().
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
LLVM_ABI instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
reverse_iterator rbegin()
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineInstrBundleIterator< MachineInstr > iterator
LLVM_ABI unsigned getConstantPoolIndex(const Constant *C, Align Alignment)
getConstantPoolIndex - Create a new entry in the constant pool or return an existing one.
Align getMaxAlign() const
Return alignment of this function's frame.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Properties which a MachineFunction may have at a given point in time.
void moveAdditionalCallInfo(const MachineInstr *Old, const MachineInstr *New)
Move the call site info from Old to \New call site info.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
bool needsWinCFI() const
True if this function uses SEH unwind opcodes and needs an unwind table entry.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *BB=nullptr, std::optional< UniqueBBID > BBID=std::nullopt)
CreateMachineInstr - Allocate a new MachineInstr.
void insert(iterator MBBI, MachineBasicBlock *MBB)
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned TargetFlags=0) const
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addConstantPoolIndex(unsigned Idx, int Offset=0, unsigned TargetFlags=0) const
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
const MachineInstrBuilder & cloneMemRefs(const MachineInstr &OtherMI) const
const MachineInstrBuilder & setMIFlags(unsigned Flags) const
const MachineInstrBuilder & copyImplicitOps(const MachineInstr &OtherMI) const
Copy all the implicit operands from OtherMI onto this one.
MachineInstr * getInstr() const
If conversion operators fail, use this method to get the MachineInstr explicitly.
Representation of each machine instruction.
LLVM_ABI void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
mop_range implicit_operands()
LLVM_ABI bool addRegisterKilled(Register IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false)
We have determined MI kills a register.
LLVM_ABI void dump() const
@ EK_Inline
EK_Inline - Jump table entries are emitted inline at their point of use.
MachineOperand class - Representation of each machine instruction operand.
static MachineOperand CreateMCSymbol(MCSymbol *Sym, unsigned TargetFlags=0)
const GlobalValue * getGlobal() const
void setImplicit(bool Val=true)
static MachineOperand CreateES(const char *SymName, unsigned TargetFlags=0)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
unsigned getTargetFlags() const
static MachineOperand CreateImm(int64_t Val)
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
static MachineOperand CreateJTI(unsigned Idx, unsigned TargetFlags=0)
const char * getSymbolName() const
void setIsUndef(bool Val=true)
Register getReg() const
getReg - Returns the register number.
static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset, unsigned TargetFlags=0)
MCSymbol * getMCSymbol() const
@ MO_CFIIndex
MCCFIInstruction index.
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_MCSymbol
MCSymbol reference (for debug/eh info)
@ MO_Predicate
Generic predicate for ISel.
@ MO_GlobalAddress
Address of a global value.
@ MO_RegisterMask
Mask of preserved registers.
@ MO_ShuffleMask
Other IR Constant for ISel (shuffle masks)
@ MO_CImmediate
Immediate >64bit operand.
@ MO_BlockAddress
Address of a basic block.
@ MO_DbgInstrRef
Integer indices referring to an instruction+operand.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_LaneMask
Mask to represent active parts of registers.
@ MO_FrameIndex
Abstract Stack Frame Index.
@ MO_Register
Register operand.
@ MO_ExternalSymbol
Name of external global symbol.
@ MO_IntrinsicID
Intrinsic ID for ISel.
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
@ MO_TargetIndex
Target-dependent index+offset operand.
@ MO_Metadata
Metadata reference (for debug info)
@ MO_FPImmediate
Floating-point immediate operand.
@ MO_RegisterLiveOut
Mask of live-out registers.
int64_t getOffset() const
Return the offset from the symbol in this operand.
Wrapper class representing virtual and physical registers.
constexpr bool isValid() const
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
bool hasFP(const MachineFunction &MF) const
hasFP - Return true if the specified function should have a dedicated frame pointer register.
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetFrameLowering * getFrameLowering() const
self_iterator getIterator()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
@ GOT_PREL
Thread Local Storage (General Dynamic Mode)
@ MO_LO16
MO_LO16 - On a symbol operand, this represents a relocation containing lower 16 bit of the address.
@ MO_LO_0_7
MO_LO_0_7 - On a symbol operand, this represents a relocation containing bits 0 through 7 of the addr...
@ MO_LO_8_15
MO_LO_8_15 - On a symbol operand, this represents a relocation containing bits 8 through 15 of the ad...
@ MO_HI_8_15
MO_HI_8_15 - On a symbol operand, this represents a relocation containing bits 24 through 31 of the a...
@ MO_HI16
MO_HI16 - On a symbol operand, this represents a relocation containing higher 16 bit of the address.
@ MO_HI_0_7
MO_HI_0_7 - On a symbol operand, this represents a relocation containing bits 16 through 23 of the ad...
@ MO_GOT
MO_GOT - On a symbol operand, this represents a GOT relative relocation.
unsigned getSOImmTwoPartSecond(unsigned V)
getSOImmTwoPartSecond - If V is a value that satisfies isSOImmTwoPartVal, return the second chunk of ...
bool isSOImmTwoPartVal(unsigned V)
isSOImmTwoPartVal - Return true if the specified value can be obtained by or'ing together two SOImmVa...
unsigned getSORegOpc(ShiftOpc ShOp, unsigned Imm)
unsigned getSOImmTwoPartFirst(unsigned V)
getSOImmTwoPartFirst - If V is a value that satisfies isSOImmTwoPartVal, return the first chunk of it...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
@ HI16
High 16 bits of absolute address.
@ LO16
Low 16 bits of absolute address.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
bool operator<(int64_t V1, const APSInt &V2)
LLVM_ABI void finalizeBundle(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
finalizeBundle - Finalize a machine instruction bundle which includes a sequence of instructions star...
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
RegState
Flags to represent properties of register accesses.
@ Kill
The last use of a register.
@ Define
Register definition.
constexpr RegState getKillRegState(bool B)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
constexpr RegState getDeadRegState(bool B)
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
constexpr RegState getRenamableRegState(bool B)
void sort(IteratorTy Start, IteratorTy End)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool is_sorted(R &&Range, Compare C)
Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a...
constexpr RegState getDefRegState(bool B)
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
RegState getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
void emitThumbRegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, Register DestReg, Register BaseReg, int NumBytes, const TargetInstrInfo &TII, const ARMBaseRegisterInfo &MRI, unsigned MIFlags=0)
emitThumbRegPlusImmediate - Emits a series of instructions to materialize a destreg = basereg + immed...
ARMCC::CondCodes getInstrPredicate(const MachineInstr &MI, Register &PredReg)
getInstrPredicate - If instruction is predicated, returns its predicate condition,...
DWARFExpression::Operation Op
static MachineOperand t1CondCodeOp(bool isDead=false)
Get the operand corresponding to the conditional code result for Thumb1.
LLVM_ABI void computeAndAddLiveIns(LivePhysRegs &LiveRegs, MachineBasicBlock &MBB)
Convenience function combining computeLiveIns() and addLiveIns().
static MachineOperand condCodeOp(unsigned CCReg=0)
Get the operand corresponding to the conditional code result.
FunctionPass * createARMExpandPseudoPass()
createARMExpandPseudoPass - returns an instance of the pseudo instruction expansion pass.
unsigned gettBLXrOpcode(const MachineFunction &MF)
@ End
Run the machine verifier once, at the end of the pipeline.
unsigned getBLXOpcode(const MachineFunction &MF)
void emitARMRegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, Register DestReg, Register BaseReg, int NumBytes, ARMCC::CondCodes Pred, Register PredReg, const ARMBaseInstrInfo &TII, unsigned MIFlags=0)
emitARMRegPlusImmediate / emitT2RegPlusImmediate - Emits a series of instructions to materializea des...
constexpr RegState getUndefRegState(bool B)
void emitT2RegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, Register DestReg, Register BaseReg, int NumBytes, ARMCC::CondCodes Pred, Register PredReg, const ARMBaseInstrInfo &TII, unsigned MIFlags=0)
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.