32#define DEBUG_TYPE "arm-pseudo"
36 cl::desc(
"Verify machine code after expanding ARM pseudos"));
38#define ARM_EXPAND_PSEUDO_NAME "ARM pseudo instruction expansion pass"
55 MachineFunctionProperties::Property::NoVRegs);
71 unsigned Opc,
bool IsExt);
111 unsigned StrexOp,
unsigned UxtOp,
118 char ARMExpandPseudo::ID = 0;
129 enum NEONRegSpacing {
140 struct NEONLdStTableEntry {
145 bool hasWritebackOperand;
154 bool copyAllListRegs;
157 bool operator<(
const NEONLdStTableEntry &TE)
const {
158 return PseudoOpc < TE.PseudoOpc;
160 friend bool operator<(
const NEONLdStTableEntry &TE,
unsigned PseudoOpc) {
161 return TE.PseudoOpc < PseudoOpc;
164 const NEONLdStTableEntry &TE) {
165 return PseudoOpc < TE.PseudoOpc;
171{ ARM::VLD1LNq16Pseudo, ARM::VLD1LNd16,
true,
false,
false, EvenDblSpc, 1, 4 ,
true},
172{ ARM::VLD1LNq16Pseudo_UPD, ARM::VLD1LNd16_UPD,
true,
true,
true, EvenDblSpc, 1, 4 ,
true},
173{ ARM::VLD1LNq32Pseudo, ARM::VLD1LNd32,
true,
false,
false, EvenDblSpc, 1, 2 ,
true},
174{ ARM::VLD1LNq32Pseudo_UPD, ARM::VLD1LNd32_UPD,
true,
true,
true, EvenDblSpc, 1, 2 ,
true},
175{ ARM::VLD1LNq8Pseudo, ARM::VLD1LNd8,
true,
false,
false, EvenDblSpc, 1, 8 ,
true},
176{ ARM::VLD1LNq8Pseudo_UPD, ARM::VLD1LNd8_UPD,
true,
true,
true, EvenDblSpc, 1, 8 ,
true},
178{ ARM::VLD1d16QPseudo, ARM::VLD1d16Q,
true,
false,
false, SingleSpc, 4, 4 ,
false},
179{ ARM::VLD1d16QPseudoWB_fixed, ARM::VLD1d16Qwb_fixed,
true,
true,
false, SingleSpc, 4, 4 ,
false},
180{ ARM::VLD1d16QPseudoWB_register, ARM::VLD1d16Qwb_register,
true,
true,
true, SingleSpc, 4, 4 ,
false},
181{ ARM::VLD1d16TPseudo, ARM::VLD1d16T,
true,
false,
false, SingleSpc, 3, 4 ,
false},
182{ ARM::VLD1d16TPseudoWB_fixed, ARM::VLD1d16Twb_fixed,
true,
true,
false, SingleSpc, 3, 4 ,
false},
183{ ARM::VLD1d16TPseudoWB_register, ARM::VLD1d16Twb_register,
true,
true,
true, SingleSpc, 3, 4 ,
false},
185{ ARM::VLD1d32QPseudo, ARM::VLD1d32Q,
true,
false,
false, SingleSpc, 4, 2 ,
false},
186{ ARM::VLD1d32QPseudoWB_fixed, ARM::VLD1d32Qwb_fixed,
true,
true,
false, SingleSpc, 4, 2 ,
false},
187{ ARM::VLD1d32QPseudoWB_register, ARM::VLD1d32Qwb_register,
true,
true,
true, SingleSpc, 4, 2 ,
false},
188{ ARM::VLD1d32TPseudo, ARM::VLD1d32T,
true,
false,
false, SingleSpc, 3, 2 ,
false},
189{ ARM::VLD1d32TPseudoWB_fixed, ARM::VLD1d32Twb_fixed,
true,
true,
false, SingleSpc, 3, 2 ,
false},
190{ ARM::VLD1d32TPseudoWB_register, ARM::VLD1d32Twb_register,
true,
true,
true, SingleSpc, 3, 2 ,
false},
192{ ARM::VLD1d64QPseudo, ARM::VLD1d64Q,
true,
false,
false, SingleSpc, 4, 1 ,
false},
193{ ARM::VLD1d64QPseudoWB_fixed, ARM::VLD1d64Qwb_fixed,
true,
true,
false, SingleSpc, 4, 1 ,
false},
194{ ARM::VLD1d64QPseudoWB_register, ARM::VLD1d64Qwb_register,
true,
true,
true, SingleSpc, 4, 1 ,
false},
195{ ARM::VLD1d64TPseudo, ARM::VLD1d64T,
true,
false,
false, SingleSpc, 3, 1 ,
false},
196{ ARM::VLD1d64TPseudoWB_fixed, ARM::VLD1d64Twb_fixed,
true,
true,
false, SingleSpc, 3, 1 ,
false},
197{ ARM::VLD1d64TPseudoWB_register, ARM::VLD1d64Twb_register,
true,
true,
true, SingleSpc, 3, 1 ,
false},
199{ ARM::VLD1d8QPseudo, ARM::VLD1d8Q,
true,
false,
false, SingleSpc, 4, 8 ,
false},
200{ ARM::VLD1d8QPseudoWB_fixed, ARM::VLD1d8Qwb_fixed,
true,
true,
false, SingleSpc, 4, 8 ,
false},
201{ ARM::VLD1d8QPseudoWB_register, ARM::VLD1d8Qwb_register,
true,
true,
true, SingleSpc, 4, 8 ,
false},
202{ ARM::VLD1d8TPseudo, ARM::VLD1d8T,
true,
false,
false, SingleSpc, 3, 8 ,
false},
203{ ARM::VLD1d8TPseudoWB_fixed, ARM::VLD1d8Twb_fixed,
true,
true,
false, SingleSpc, 3, 8 ,
false},
204{ ARM::VLD1d8TPseudoWB_register, ARM::VLD1d8Twb_register,
true,
true,
true, SingleSpc, 3, 8 ,
false},
206{ ARM::VLD1q16HighQPseudo, ARM::VLD1d16Q,
true,
false,
false, SingleHighQSpc, 4, 4 ,
false},
207{ ARM::VLD1q16HighQPseudo_UPD, ARM::VLD1d16Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 4 ,
false},
208{ ARM::VLD1q16HighTPseudo, ARM::VLD1d16T,
true,
false,
false, SingleHighTSpc, 3, 4 ,
false},
209{ ARM::VLD1q16HighTPseudo_UPD, ARM::VLD1d16Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 4 ,
false},
210{ ARM::VLD1q16LowQPseudo_UPD, ARM::VLD1d16Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 4 ,
false},
211{ ARM::VLD1q16LowTPseudo_UPD, ARM::VLD1d16Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 4 ,
false},
213{ ARM::VLD1q32HighQPseudo, ARM::VLD1d32Q,
true,
false,
false, SingleHighQSpc, 4, 2 ,
false},
214{ ARM::VLD1q32HighQPseudo_UPD, ARM::VLD1d32Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 2 ,
false},
215{ ARM::VLD1q32HighTPseudo, ARM::VLD1d32T,
true,
false,
false, SingleHighTSpc, 3, 2 ,
false},
216{ ARM::VLD1q32HighTPseudo_UPD, ARM::VLD1d32Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 2 ,
false},
217{ ARM::VLD1q32LowQPseudo_UPD, ARM::VLD1d32Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 2 ,
false},
218{ ARM::VLD1q32LowTPseudo_UPD, ARM::VLD1d32Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 2 ,
false},
220{ ARM::VLD1q64HighQPseudo, ARM::VLD1d64Q,
true,
false,
false, SingleHighQSpc, 4, 1 ,
false},
221{ ARM::VLD1q64HighQPseudo_UPD, ARM::VLD1d64Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 1 ,
false},
222{ ARM::VLD1q64HighTPseudo, ARM::VLD1d64T,
true,
false,
false, SingleHighTSpc, 3, 1 ,
false},
223{ ARM::VLD1q64HighTPseudo_UPD, ARM::VLD1d64Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 1 ,
false},
224{ ARM::VLD1q64LowQPseudo_UPD, ARM::VLD1d64Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 1 ,
false},
225{ ARM::VLD1q64LowTPseudo_UPD, ARM::VLD1d64Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 1 ,
false},
227{ ARM::VLD1q8HighQPseudo, ARM::VLD1d8Q,
true,
false,
false, SingleHighQSpc, 4, 8 ,
false},
228{ ARM::VLD1q8HighQPseudo_UPD, ARM::VLD1d8Qwb_fixed,
true,
true,
true, SingleHighQSpc, 4, 8 ,
false},
229{ ARM::VLD1q8HighTPseudo, ARM::VLD1d8T,
true,
false,
false, SingleHighTSpc, 3, 8 ,
false},
230{ ARM::VLD1q8HighTPseudo_UPD, ARM::VLD1d8Twb_fixed,
true,
true,
true, SingleHighTSpc, 3, 8 ,
false},
231{ ARM::VLD1q8LowQPseudo_UPD, ARM::VLD1d8Qwb_fixed,
true,
true,
true, SingleLowSpc, 4, 8 ,
false},
232{ ARM::VLD1q8LowTPseudo_UPD, ARM::VLD1d8Twb_fixed,
true,
true,
true, SingleLowSpc, 3, 8 ,
false},
234{ ARM::VLD2DUPq16EvenPseudo, ARM::VLD2DUPd16x2,
true,
false,
false, EvenDblSpc, 2, 4 ,
false},
235{ ARM::VLD2DUPq16OddPseudo, ARM::VLD2DUPd16x2,
true,
false,
false, OddDblSpc, 2, 4 ,
false},
236{ ARM::VLD2DUPq16OddPseudoWB_fixed, ARM::VLD2DUPd16x2wb_fixed,
true,
true,
false, OddDblSpc, 2, 4 ,
false},
237{ ARM::VLD2DUPq16OddPseudoWB_register, ARM::VLD2DUPd16x2wb_register,
true,
true,
true, OddDblSpc, 2, 4 ,
false},
238{ ARM::VLD2DUPq32EvenPseudo, ARM::VLD2DUPd32x2,
true,
false,
false, EvenDblSpc, 2, 2 ,
false},
239{ ARM::VLD2DUPq32OddPseudo, ARM::VLD2DUPd32x2,
true,
false,
false, OddDblSpc, 2, 2 ,
false},
240{ ARM::VLD2DUPq32OddPseudoWB_fixed, ARM::VLD2DUPd32x2wb_fixed,
true,
true,
false, OddDblSpc, 2, 2 ,
false},
241{ ARM::VLD2DUPq32OddPseudoWB_register, ARM::VLD2DUPd32x2wb_register,
true,
true,
true, OddDblSpc, 2, 2 ,
false},
242{ ARM::VLD2DUPq8EvenPseudo, ARM::VLD2DUPd8x2,
true,
false,
false, EvenDblSpc, 2, 8 ,
false},
243{ ARM::VLD2DUPq8OddPseudo, ARM::VLD2DUPd8x2,
true,
false,
false, OddDblSpc, 2, 8 ,
false},
244{ ARM::VLD2DUPq8OddPseudoWB_fixed, ARM::VLD2DUPd8x2wb_fixed,
true,
true,
false, OddDblSpc, 2, 8 ,
false},
245{ ARM::VLD2DUPq8OddPseudoWB_register, ARM::VLD2DUPd8x2wb_register,
true,
true,
true, OddDblSpc, 2, 8 ,
false},
247{ ARM::VLD2LNd16Pseudo, ARM::VLD2LNd16,
true,
false,
false, SingleSpc, 2, 4 ,
true},
248{ ARM::VLD2LNd16Pseudo_UPD, ARM::VLD2LNd16_UPD,
true,
true,
true, SingleSpc, 2, 4 ,
true},
249{ ARM::VLD2LNd32Pseudo, ARM::VLD2LNd32,
true,
false,
false, SingleSpc, 2, 2 ,
true},
250{ ARM::VLD2LNd32Pseudo_UPD, ARM::VLD2LNd32_UPD,
true,
true,
true, SingleSpc, 2, 2 ,
true},
251{ ARM::VLD2LNd8Pseudo, ARM::VLD2LNd8,
true,
false,
false, SingleSpc, 2, 8 ,
true},
252{ ARM::VLD2LNd8Pseudo_UPD, ARM::VLD2LNd8_UPD,
true,
true,
true, SingleSpc, 2, 8 ,
true},
253{ ARM::VLD2LNq16Pseudo, ARM::VLD2LNq16,
true,
false,
false, EvenDblSpc, 2, 4 ,
true},
254{ ARM::VLD2LNq16Pseudo_UPD, ARM::VLD2LNq16_UPD,
true,
true,
true, EvenDblSpc, 2, 4 ,
true},
255{ ARM::VLD2LNq32Pseudo, ARM::VLD2LNq32,
true,
false,
false, EvenDblSpc, 2, 2 ,
true},
256{ ARM::VLD2LNq32Pseudo_UPD, ARM::VLD2LNq32_UPD,
true,
true,
true, EvenDblSpc, 2, 2 ,
true},
258{ ARM::VLD2q16Pseudo, ARM::VLD2q16,
true,
false,
false, SingleSpc, 4, 4 ,
false},
259{ ARM::VLD2q16PseudoWB_fixed, ARM::VLD2q16wb_fixed,
true,
true,
false, SingleSpc, 4, 4 ,
false},
260{ ARM::VLD2q16PseudoWB_register, ARM::VLD2q16wb_register,
true,
true,
true, SingleSpc, 4, 4 ,
false},
261{ ARM::VLD2q32Pseudo, ARM::VLD2q32,
true,
false,
false, SingleSpc, 4, 2 ,
false},
262{ ARM::VLD2q32PseudoWB_fixed, ARM::VLD2q32wb_fixed,
true,
true,
false, SingleSpc, 4, 2 ,
false},
263{ ARM::VLD2q32PseudoWB_register, ARM::VLD2q32wb_register,
true,
true,
true, SingleSpc, 4, 2 ,
false},
264{ ARM::VLD2q8Pseudo, ARM::VLD2q8,
true,
false,
false, SingleSpc, 4, 8 ,
false},
265{ ARM::VLD2q8PseudoWB_fixed, ARM::VLD2q8wb_fixed,
true,
true,
false, SingleSpc, 4, 8 ,
false},
266{ ARM::VLD2q8PseudoWB_register, ARM::VLD2q8wb_register,
true,
true,
true, SingleSpc, 4, 8 ,
false},
268{ ARM::VLD3DUPd16Pseudo, ARM::VLD3DUPd16,
true,
false,
false, SingleSpc, 3, 4,
true},
269{ ARM::VLD3DUPd16Pseudo_UPD, ARM::VLD3DUPd16_UPD,
true,
true,
true, SingleSpc, 3, 4,
true},
270{ ARM::VLD3DUPd32Pseudo, ARM::VLD3DUPd32,
true,
false,
false, SingleSpc, 3, 2,
true},
271{ ARM::VLD3DUPd32Pseudo_UPD, ARM::VLD3DUPd32_UPD,
true,
true,
true, SingleSpc, 3, 2,
true},
272{ ARM::VLD3DUPd8Pseudo, ARM::VLD3DUPd8,
true,
false,
false, SingleSpc, 3, 8,
true},
273{ ARM::VLD3DUPd8Pseudo_UPD, ARM::VLD3DUPd8_UPD,
true,
true,
true, SingleSpc, 3, 8,
true},
274{ ARM::VLD3DUPq16EvenPseudo, ARM::VLD3DUPq16,
true,
false,
false, EvenDblSpc, 3, 4 ,
true},
275{ ARM::VLD3DUPq16OddPseudo, ARM::VLD3DUPq16,
true,
false,
false, OddDblSpc, 3, 4 ,
true},
276{ ARM::VLD3DUPq16OddPseudo_UPD, ARM::VLD3DUPq16_UPD,
true,
true,
true, OddDblSpc, 3, 4 ,
true},
277{ ARM::VLD3DUPq32EvenPseudo, ARM::VLD3DUPq32,
true,
false,
false, EvenDblSpc, 3, 2 ,
true},
278{ ARM::VLD3DUPq32OddPseudo, ARM::VLD3DUPq32,
true,
false,
false, OddDblSpc, 3, 2 ,
true},
279{ ARM::VLD3DUPq32OddPseudo_UPD, ARM::VLD3DUPq32_UPD,
true,
true,
true, OddDblSpc, 3, 2 ,
true},
280{ ARM::VLD3DUPq8EvenPseudo, ARM::VLD3DUPq8,
true,
false,
false, EvenDblSpc, 3, 8 ,
true},
281{ ARM::VLD3DUPq8OddPseudo, ARM::VLD3DUPq8,
true,
false,
false, OddDblSpc, 3, 8 ,
true},
282{ ARM::VLD3DUPq8OddPseudo_UPD, ARM::VLD3DUPq8_UPD,
true,
true,
true, OddDblSpc, 3, 8 ,
true},
284{ ARM::VLD3LNd16Pseudo, ARM::VLD3LNd16,
true,
false,
false, SingleSpc, 3, 4 ,
true},
285{ ARM::VLD3LNd16Pseudo_UPD, ARM::VLD3LNd16_UPD,
true,
true,
true, SingleSpc, 3, 4 ,
true},
286{ ARM::VLD3LNd32Pseudo, ARM::VLD3LNd32,
true,
false,
false, SingleSpc, 3, 2 ,
true},
287{ ARM::VLD3LNd32Pseudo_UPD, ARM::VLD3LNd32_UPD,
true,
true,
true, SingleSpc, 3, 2 ,
true},
288{ ARM::VLD3LNd8Pseudo, ARM::VLD3LNd8,
true,
false,
false, SingleSpc, 3, 8 ,
true},
289{ ARM::VLD3LNd8Pseudo_UPD, ARM::VLD3LNd8_UPD,
true,
true,
true, SingleSpc, 3, 8 ,
true},
290{ ARM::VLD3LNq16Pseudo, ARM::VLD3LNq16,
true,
false,
false, EvenDblSpc, 3, 4 ,
true},
291{ ARM::VLD3LNq16Pseudo_UPD, ARM::VLD3LNq16_UPD,
true,
true,
true, EvenDblSpc, 3, 4 ,
true},
292{ ARM::VLD3LNq32Pseudo, ARM::VLD3LNq32,
true,
false,
false, EvenDblSpc, 3, 2 ,
true},
293{ ARM::VLD3LNq32Pseudo_UPD, ARM::VLD3LNq32_UPD,
true,
true,
true, EvenDblSpc, 3, 2 ,
true},
295{ ARM::VLD3d16Pseudo, ARM::VLD3d16,
true,
false,
false, SingleSpc, 3, 4 ,
true},
296{ ARM::VLD3d16Pseudo_UPD, ARM::VLD3d16_UPD,
true,
true,
true, SingleSpc, 3, 4 ,
true},
297{ ARM::VLD3d32Pseudo, ARM::VLD3d32,
true,
false,
false, SingleSpc, 3, 2 ,
true},
298{ ARM::VLD3d32Pseudo_UPD, ARM::VLD3d32_UPD,
true,
true,
true, SingleSpc, 3, 2 ,
true},
299{ ARM::VLD3d8Pseudo, ARM::VLD3d8,
true,
false,
false, SingleSpc, 3, 8 ,
true},
300{ ARM::VLD3d8Pseudo_UPD, ARM::VLD3d8_UPD,
true,
true,
true, SingleSpc, 3, 8 ,
true},
302{ ARM::VLD3q16Pseudo_UPD, ARM::VLD3q16_UPD,
true,
true,
true, EvenDblSpc, 3, 4 ,
true},
303{ ARM::VLD3q16oddPseudo, ARM::VLD3q16,
true,
false,
false, OddDblSpc, 3, 4 ,
true},
304{ ARM::VLD3q16oddPseudo_UPD, ARM::VLD3q16_UPD,
true,
true,
true, OddDblSpc, 3, 4 ,
true},
305{ ARM::VLD3q32Pseudo_UPD, ARM::VLD3q32_UPD,
true,
true,
true, EvenDblSpc, 3, 2 ,
true},
306{ ARM::VLD3q32oddPseudo, ARM::VLD3q32,
true,
false,
false, OddDblSpc, 3, 2 ,
true},
307{ ARM::VLD3q32oddPseudo_UPD, ARM::VLD3q32_UPD,
true,
true,
true, OddDblSpc, 3, 2 ,
true},
308{ ARM::VLD3q8Pseudo_UPD, ARM::VLD3q8_UPD,
true,
true,
true, EvenDblSpc, 3, 8 ,
true},
309{ ARM::VLD3q8oddPseudo, ARM::VLD3q8,
true,
false,
false, OddDblSpc, 3, 8 ,
true},
310{ ARM::VLD3q8oddPseudo_UPD, ARM::VLD3q8_UPD,
true,
true,
true, OddDblSpc, 3, 8 ,
true},
312{ ARM::VLD4DUPd16Pseudo, ARM::VLD4DUPd16,
true,
false,
false, SingleSpc, 4, 4,
true},
313{ ARM::VLD4DUPd16Pseudo_UPD, ARM::VLD4DUPd16_UPD,
true,
true,
true, SingleSpc, 4, 4,
true},
314{ ARM::VLD4DUPd32Pseudo, ARM::VLD4DUPd32,
true,
false,
false, SingleSpc, 4, 2,
true},
315{ ARM::VLD4DUPd32Pseudo_UPD, ARM::VLD4DUPd32_UPD,
true,
true,
true, SingleSpc, 4, 2,
true},
316{ ARM::VLD4DUPd8Pseudo, ARM::VLD4DUPd8,
true,
false,
false, SingleSpc, 4, 8,
true},
317{ ARM::VLD4DUPd8Pseudo_UPD, ARM::VLD4DUPd8_UPD,
true,
true,
true, SingleSpc, 4, 8,
true},
318{ ARM::VLD4DUPq16EvenPseudo, ARM::VLD4DUPq16,
true,
false,
false, EvenDblSpc, 4, 4 ,
true},
319{ ARM::VLD4DUPq16OddPseudo, ARM::VLD4DUPq16,
true,
false,
false, OddDblSpc, 4, 4 ,
true},
320{ ARM::VLD4DUPq16OddPseudo_UPD, ARM::VLD4DUPq16_UPD,
true,
true,
true, OddDblSpc, 4, 4 ,
true},
321{ ARM::VLD4DUPq32EvenPseudo, ARM::VLD4DUPq32,
true,
false,
false, EvenDblSpc, 4, 2 ,
true},
322{ ARM::VLD4DUPq32OddPseudo, ARM::VLD4DUPq32,
true,
false,
false, OddDblSpc, 4, 2 ,
true},
323{ ARM::VLD4DUPq32OddPseudo_UPD, ARM::VLD4DUPq32_UPD,
true,
true,
true, OddDblSpc, 4, 2 ,
true},
324{ ARM::VLD4DUPq8EvenPseudo, ARM::VLD4DUPq8,
true,
false,
false, EvenDblSpc, 4, 8 ,
true},
325{ ARM::VLD4DUPq8OddPseudo, ARM::VLD4DUPq8,
true,
false,
false, OddDblSpc, 4, 8 ,
true},
326{ ARM::VLD4DUPq8OddPseudo_UPD, ARM::VLD4DUPq8_UPD,
true,
true,
true, OddDblSpc, 4, 8 ,
true},
328{ ARM::VLD4LNd16Pseudo, ARM::VLD4LNd16,
true,
false,
false, SingleSpc, 4, 4 ,
true},
329{ ARM::VLD4LNd16Pseudo_UPD, ARM::VLD4LNd16_UPD,
true,
true,
true, SingleSpc, 4, 4 ,
true},
330{ ARM::VLD4LNd32Pseudo, ARM::VLD4LNd32,
true,
false,
false, SingleSpc, 4, 2 ,
true},
331{ ARM::VLD4LNd32Pseudo_UPD, ARM::VLD4LNd32_UPD,
true,
true,
true, SingleSpc, 4, 2 ,
true},
332{ ARM::VLD4LNd8Pseudo, ARM::VLD4LNd8,
true,
false,
false, SingleSpc, 4, 8 ,
true},
333{ ARM::VLD4LNd8Pseudo_UPD, ARM::VLD4LNd8_UPD,
true,
true,
true, SingleSpc, 4, 8 ,
true},
334{ ARM::VLD4LNq16Pseudo, ARM::VLD4LNq16,
true,
false,
false, EvenDblSpc, 4, 4 ,
true},
335{ ARM::VLD4LNq16Pseudo_UPD, ARM::VLD4LNq16_UPD,
true,
true,
true, EvenDblSpc, 4, 4 ,
true},
336{ ARM::VLD4LNq32Pseudo, ARM::VLD4LNq32,
true,
false,
false, EvenDblSpc, 4, 2 ,
true},
337{ ARM::VLD4LNq32Pseudo_UPD, ARM::VLD4LNq32_UPD,
true,
true,
true, EvenDblSpc, 4, 2 ,
true},
339{ ARM::VLD4d16Pseudo, ARM::VLD4d16,
true,
false,
false, SingleSpc, 4, 4 ,
true},
340{ ARM::VLD4d16Pseudo_UPD, ARM::VLD4d16_UPD,
true,
true,
true, SingleSpc, 4, 4 ,
true},
341{ ARM::VLD4d32Pseudo, ARM::VLD4d32,
true,
false,
false, SingleSpc, 4, 2 ,
true},
342{ ARM::VLD4d32Pseudo_UPD, ARM::VLD4d32_UPD,
true,
true,
true, SingleSpc, 4, 2 ,
true},
343{ ARM::VLD4d8Pseudo, ARM::VLD4d8,
true,
false,
false, SingleSpc, 4, 8 ,
true},
344{ ARM::VLD4d8Pseudo_UPD, ARM::VLD4d8_UPD,
true,
true,
true, SingleSpc, 4, 8 ,
true},
346{ ARM::VLD4q16Pseudo_UPD, ARM::VLD4q16_UPD,
true,
true,
true, EvenDblSpc, 4, 4 ,
true},
347{ ARM::VLD4q16oddPseudo, ARM::VLD4q16,
true,
false,
false, OddDblSpc, 4, 4 ,
true},
348{ ARM::VLD4q16oddPseudo_UPD, ARM::VLD4q16_UPD,
true,
true,
true, OddDblSpc, 4, 4 ,
true},
349{ ARM::VLD4q32Pseudo_UPD, ARM::VLD4q32_UPD,
true,
true,
true, EvenDblSpc, 4, 2 ,
true},
350{ ARM::VLD4q32oddPseudo, ARM::VLD4q32,
true,
false,
false, OddDblSpc, 4, 2 ,
true},
351{ ARM::VLD4q32oddPseudo_UPD, ARM::VLD4q32_UPD,
true,
true,
true, OddDblSpc, 4, 2 ,
true},
352{ ARM::VLD4q8Pseudo_UPD, ARM::VLD4q8_UPD,
true,
true,
true, EvenDblSpc, 4, 8 ,
true},
353{ ARM::VLD4q8oddPseudo, ARM::VLD4q8,
true,
false,
false, OddDblSpc, 4, 8 ,
true},
354{ ARM::VLD4q8oddPseudo_UPD, ARM::VLD4q8_UPD,
true,
true,
true, OddDblSpc, 4, 8 ,
true},
356{ ARM::VST1LNq16Pseudo, ARM::VST1LNd16,
false,
false,
false, EvenDblSpc, 1, 4 ,
true},
357{ ARM::VST1LNq16Pseudo_UPD, ARM::VST1LNd16_UPD,
false,
true,
true, EvenDblSpc, 1, 4 ,
true},
358{ ARM::VST1LNq32Pseudo, ARM::VST1LNd32,
false,
false,
false, EvenDblSpc, 1, 2 ,
true},
359{ ARM::VST1LNq32Pseudo_UPD, ARM::VST1LNd32_UPD,
false,
true,
true, EvenDblSpc, 1, 2 ,
true},
360{ ARM::VST1LNq8Pseudo, ARM::VST1LNd8,
false,
false,
false, EvenDblSpc, 1, 8 ,
true},
361{ ARM::VST1LNq8Pseudo_UPD, ARM::VST1LNd8_UPD,
false,
true,
true, EvenDblSpc, 1, 8 ,
true},
363{ ARM::VST1d16QPseudo, ARM::VST1d16Q,
false,
false,
false, SingleSpc, 4, 4 ,
false},
364{ ARM::VST1d16QPseudoWB_fixed, ARM::VST1d16Qwb_fixed,
false,
true,
false, SingleSpc, 4, 4 ,
false},
365{ ARM::VST1d16QPseudoWB_register, ARM::VST1d16Qwb_register,
false,
true,
true, SingleSpc, 4, 4 ,
false},
366{ ARM::VST1d16TPseudo, ARM::VST1d16T,
false,
false,
false, SingleSpc, 3, 4 ,
false},
367{ ARM::VST1d16TPseudoWB_fixed, ARM::VST1d16Twb_fixed,
false,
true,
false, SingleSpc, 3, 4 ,
false},
368{ ARM::VST1d16TPseudoWB_register, ARM::VST1d16Twb_register,
false,
true,
true, SingleSpc, 3, 4 ,
false},
370{ ARM::VST1d32QPseudo, ARM::VST1d32Q,
false,
false,
false, SingleSpc, 4, 2 ,
false},
371{ ARM::VST1d32QPseudoWB_fixed, ARM::VST1d32Qwb_fixed,
false,
true,
false, SingleSpc, 4, 2 ,
false},
372{ ARM::VST1d32QPseudoWB_register, ARM::VST1d32Qwb_register,
false,
true,
true, SingleSpc, 4, 2 ,
false},
373{ ARM::VST1d32TPseudo, ARM::VST1d32T,
false,
false,
false, SingleSpc, 3, 2 ,
false},
374{ ARM::VST1d32TPseudoWB_fixed, ARM::VST1d32Twb_fixed,
false,
true,
false, SingleSpc, 3, 2 ,
false},
375{ ARM::VST1d32TPseudoWB_register, ARM::VST1d32Twb_register,
false,
true,
true, SingleSpc, 3, 2 ,
false},
377{ ARM::VST1d64QPseudo, ARM::VST1d64Q,
false,
false,
false, SingleSpc, 4, 1 ,
false},
378{ ARM::VST1d64QPseudoWB_fixed, ARM::VST1d64Qwb_fixed,
false,
true,
false, SingleSpc, 4, 1 ,
false},
379{ ARM::VST1d64QPseudoWB_register, ARM::VST1d64Qwb_register,
false,
true,
true, SingleSpc, 4, 1 ,
false},
380{ ARM::VST1d64TPseudo, ARM::VST1d64T,
false,
false,
false, SingleSpc, 3, 1 ,
false},
381{ ARM::VST1d64TPseudoWB_fixed, ARM::VST1d64Twb_fixed,
false,
true,
false, SingleSpc, 3, 1 ,
false},
382{ ARM::VST1d64TPseudoWB_register, ARM::VST1d64Twb_register,
false,
true,
true, SingleSpc, 3, 1 ,
false},
384{ ARM::VST1d8QPseudo, ARM::VST1d8Q,
false,
false,
false, SingleSpc, 4, 8 ,
false},
385{ ARM::VST1d8QPseudoWB_fixed, ARM::VST1d8Qwb_fixed,
false,
true,
false, SingleSpc, 4, 8 ,
false},
386{ ARM::VST1d8QPseudoWB_register, ARM::VST1d8Qwb_register,
false,
true,
true, SingleSpc, 4, 8 ,
false},
387{ ARM::VST1d8TPseudo, ARM::VST1d8T,
false,
false,
false, SingleSpc, 3, 8 ,
false},
388{ ARM::VST1d8TPseudoWB_fixed, ARM::VST1d8Twb_fixed,
false,
true,
false, SingleSpc, 3, 8 ,
false},
389{ ARM::VST1d8TPseudoWB_register, ARM::VST1d8Twb_register,
false,
true,
true, SingleSpc, 3, 8 ,
false},
391{ ARM::VST1q16HighQPseudo, ARM::VST1d16Q,
false,
false,
false, SingleHighQSpc, 4, 4 ,
false},
392{ ARM::VST1q16HighQPseudo_UPD, ARM::VST1d16Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
393{ ARM::VST1q16HighTPseudo, ARM::VST1d16T,
false,
false,
false, SingleHighTSpc, 3, 4 ,
false},
394{ ARM::VST1q16HighTPseudo_UPD, ARM::VST1d16Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 4 ,
false},
395{ ARM::VST1q16LowQPseudo_UPD, ARM::VST1d16Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 4 ,
false},
396{ ARM::VST1q16LowTPseudo_UPD, ARM::VST1d16Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 4 ,
false},
398{ ARM::VST1q32HighQPseudo, ARM::VST1d32Q,
false,
false,
false, SingleHighQSpc, 4, 2 ,
false},
399{ ARM::VST1q32HighQPseudo_UPD, ARM::VST1d32Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
400{ ARM::VST1q32HighTPseudo, ARM::VST1d32T,
false,
false,
false, SingleHighTSpc, 3, 2 ,
false},
401{ ARM::VST1q32HighTPseudo_UPD, ARM::VST1d32Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 2 ,
false},
402{ ARM::VST1q32LowQPseudo_UPD, ARM::VST1d32Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 2 ,
false},
403{ ARM::VST1q32LowTPseudo_UPD, ARM::VST1d32Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 2 ,
false},
405{ ARM::VST1q64HighQPseudo, ARM::VST1d64Q,
false,
false,
false, SingleHighQSpc, 4, 1 ,
false},
406{ ARM::VST1q64HighQPseudo_UPD, ARM::VST1d64Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
407{ ARM::VST1q64HighTPseudo, ARM::VST1d64T,
false,
false,
false, SingleHighTSpc, 3, 1 ,
false},
408{ ARM::VST1q64HighTPseudo_UPD, ARM::VST1d64Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 1 ,
false},
409{ ARM::VST1q64LowQPseudo_UPD, ARM::VST1d64Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 1 ,
false},
410{ ARM::VST1q64LowTPseudo_UPD, ARM::VST1d64Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 1 ,
false},
412{ ARM::VST1q8HighQPseudo, ARM::VST1d8Q,
false,
false,
false, SingleHighQSpc, 4, 8 ,
false},
413{ ARM::VST1q8HighQPseudo_UPD, ARM::VST1d8Qwb_fixed,
false,
true,
true, SingleHighQSpc, 4, 8 ,
false},
414{ ARM::VST1q8HighTPseudo, ARM::VST1d8T,
false,
false,
false, SingleHighTSpc, 3, 8 ,
false},
415{ ARM::VST1q8HighTPseudo_UPD, ARM::VST1d8Twb_fixed,
false,
true,
true, SingleHighTSpc, 3, 8 ,
false},
416{ ARM::VST1q8LowQPseudo_UPD, ARM::VST1d8Qwb_fixed,
false,
true,
true, SingleLowSpc, 4, 8 ,
false},
417{ ARM::VST1q8LowTPseudo_UPD, ARM::VST1d8Twb_fixed,
false,
true,
true, SingleLowSpc, 3, 8 ,
false},
419{ ARM::VST2LNd16Pseudo, ARM::VST2LNd16,
false,
false,
false, SingleSpc, 2, 4 ,
true},
420{ ARM::VST2LNd16Pseudo_UPD, ARM::VST2LNd16_UPD,
false,
true,
true, SingleSpc, 2, 4 ,
true},
421{ ARM::VST2LNd32Pseudo, ARM::VST2LNd32,
false,
false,
false, SingleSpc, 2, 2 ,
true},
422{ ARM::VST2LNd32Pseudo_UPD, ARM::VST2LNd32_UPD,
false,
true,
true, SingleSpc, 2, 2 ,
true},
423{ ARM::VST2LNd8Pseudo, ARM::VST2LNd8,
false,
false,
false, SingleSpc, 2, 8 ,
true},
424{ ARM::VST2LNd8Pseudo_UPD, ARM::VST2LNd8_UPD,
false,
true,
true, SingleSpc, 2, 8 ,
true},
425{ ARM::VST2LNq16Pseudo, ARM::VST2LNq16,
false,
false,
false, EvenDblSpc, 2, 4,
true},
426{ ARM::VST2LNq16Pseudo_UPD, ARM::VST2LNq16_UPD,
false,
true,
true, EvenDblSpc, 2, 4,
true},
427{ ARM::VST2LNq32Pseudo, ARM::VST2LNq32,
false,
false,
false, EvenDblSpc, 2, 2,
true},
428{ ARM::VST2LNq32Pseudo_UPD, ARM::VST2LNq32_UPD,
false,
true,
true, EvenDblSpc, 2, 2,
true},
430{ ARM::VST2q16Pseudo, ARM::VST2q16,
false,
false,
false, SingleSpc, 4, 4 ,
false},
431{ ARM::VST2q16PseudoWB_fixed, ARM::VST2q16wb_fixed,
false,
true,
false, SingleSpc, 4, 4 ,
false},
432{ ARM::VST2q16PseudoWB_register, ARM::VST2q16wb_register,
false,
true,
true, SingleSpc, 4, 4 ,
false},
433{ ARM::VST2q32Pseudo, ARM::VST2q32,
false,
false,
false, SingleSpc, 4, 2 ,
false},
434{ ARM::VST2q32PseudoWB_fixed, ARM::VST2q32wb_fixed,
false,
true,
false, SingleSpc, 4, 2 ,
false},
435{ ARM::VST2q32PseudoWB_register, ARM::VST2q32wb_register,
false,
true,
true, SingleSpc, 4, 2 ,
false},
436{ ARM::VST2q8Pseudo, ARM::VST2q8,
false,
false,
false, SingleSpc, 4, 8 ,
false},
437{ ARM::VST2q8PseudoWB_fixed, ARM::VST2q8wb_fixed,
false,
true,
false, SingleSpc, 4, 8 ,
false},
438{ ARM::VST2q8PseudoWB_register, ARM::VST2q8wb_register,
false,
true,
true, SingleSpc, 4, 8 ,
false},
440{ ARM::VST3LNd16Pseudo, ARM::VST3LNd16,
false,
false,
false, SingleSpc, 3, 4 ,
true},
441{ ARM::VST3LNd16Pseudo_UPD, ARM::VST3LNd16_UPD,
false,
true,
true, SingleSpc, 3, 4 ,
true},
442{ ARM::VST3LNd32Pseudo, ARM::VST3LNd32,
false,
false,
false, SingleSpc, 3, 2 ,
true},
443{ ARM::VST3LNd32Pseudo_UPD, ARM::VST3LNd32_UPD,
false,
true,
true, SingleSpc, 3, 2 ,
true},
444{ ARM::VST3LNd8Pseudo, ARM::VST3LNd8,
false,
false,
false, SingleSpc, 3, 8 ,
true},
445{ ARM::VST3LNd8Pseudo_UPD, ARM::VST3LNd8_UPD,
false,
true,
true, SingleSpc, 3, 8 ,
true},
446{ ARM::VST3LNq16Pseudo, ARM::VST3LNq16,
false,
false,
false, EvenDblSpc, 3, 4,
true},
447{ ARM::VST3LNq16Pseudo_UPD, ARM::VST3LNq16_UPD,
false,
true,
true, EvenDblSpc, 3, 4,
true},
448{ ARM::VST3LNq32Pseudo, ARM::VST3LNq32,
false,
false,
false, EvenDblSpc, 3, 2,
true},
449{ ARM::VST3LNq32Pseudo_UPD, ARM::VST3LNq32_UPD,
false,
true,
true, EvenDblSpc, 3, 2,
true},
451{ ARM::VST3d16Pseudo, ARM::VST3d16,
false,
false,
false, SingleSpc, 3, 4 ,
true},
452{ ARM::VST3d16Pseudo_UPD, ARM::VST3d16_UPD,
false,
true,
true, SingleSpc, 3, 4 ,
true},
453{ ARM::VST3d32Pseudo, ARM::VST3d32,
false,
false,
false, SingleSpc, 3, 2 ,
true},
454{ ARM::VST3d32Pseudo_UPD, ARM::VST3d32_UPD,
false,
true,
true, SingleSpc, 3, 2 ,
true},
455{ ARM::VST3d8Pseudo, ARM::VST3d8,
false,
false,
false, SingleSpc, 3, 8 ,
true},
456{ ARM::VST3d8Pseudo_UPD, ARM::VST3d8_UPD,
false,
true,
true, SingleSpc, 3, 8 ,
true},
458{ ARM::VST3q16Pseudo_UPD, ARM::VST3q16_UPD,
false,
true,
true, EvenDblSpc, 3, 4 ,
true},
459{ ARM::VST3q16oddPseudo, ARM::VST3q16,
false,
false,
false, OddDblSpc, 3, 4 ,
true},
460{ ARM::VST3q16oddPseudo_UPD, ARM::VST3q16_UPD,
false,
true,
true, OddDblSpc, 3, 4 ,
true},
461{ ARM::VST3q32Pseudo_UPD, ARM::VST3q32_UPD,
false,
true,
true, EvenDblSpc, 3, 2 ,
true},
462{ ARM::VST3q32oddPseudo, ARM::VST3q32,
false,
false,
false, OddDblSpc, 3, 2 ,
true},
463{ ARM::VST3q32oddPseudo_UPD, ARM::VST3q32_UPD,
false,
true,
true, OddDblSpc, 3, 2 ,
true},
464{ ARM::VST3q8Pseudo_UPD, ARM::VST3q8_UPD,
false,
true,
true, EvenDblSpc, 3, 8 ,
true},
465{ ARM::VST3q8oddPseudo, ARM::VST3q8,
false,
false,
false, OddDblSpc, 3, 8 ,
true},
466{ ARM::VST3q8oddPseudo_UPD, ARM::VST3q8_UPD,
false,
true,
true, OddDblSpc, 3, 8 ,
true},
468{ ARM::VST4LNd16Pseudo, ARM::VST4LNd16,
false,
false,
false, SingleSpc, 4, 4 ,
true},
469{ ARM::VST4LNd16Pseudo_UPD, ARM::VST4LNd16_UPD,
false,
true,
true, SingleSpc, 4, 4 ,
true},
470{ ARM::VST4LNd32Pseudo, ARM::VST4LNd32,
false,
false,
false, SingleSpc, 4, 2 ,
true},
471{ ARM::VST4LNd32Pseudo_UPD, ARM::VST4LNd32_UPD,
false,
true,
true, SingleSpc, 4, 2 ,
true},
472{ ARM::VST4LNd8Pseudo, ARM::VST4LNd8,
false,
false,
false, SingleSpc, 4, 8 ,
true},
473{ ARM::VST4LNd8Pseudo_UPD, ARM::VST4LNd8_UPD,
false,
true,
true, SingleSpc, 4, 8 ,
true},
474{ ARM::VST4LNq16Pseudo, ARM::VST4LNq16,
false,
false,
false, EvenDblSpc, 4, 4,
true},
475{ ARM::VST4LNq16Pseudo_UPD, ARM::VST4LNq16_UPD,
false,
true,
true, EvenDblSpc, 4, 4,
true},
476{ ARM::VST4LNq32Pseudo, ARM::VST4LNq32,
false,
false,
false, EvenDblSpc, 4, 2,
true},
477{ ARM::VST4LNq32Pseudo_UPD, ARM::VST4LNq32_UPD,
false,
true,
true, EvenDblSpc, 4, 2,
true},
479{ ARM::VST4d16Pseudo, ARM::VST4d16,
false,
false,
false, SingleSpc, 4, 4 ,
true},
480{ ARM::VST4d16Pseudo_UPD, ARM::VST4d16_UPD,
false,
true,
true, SingleSpc, 4, 4 ,
true},
481{ ARM::VST4d32Pseudo, ARM::VST4d32,
false,
false,
false, SingleSpc, 4, 2 ,
true},
482{ ARM::VST4d32Pseudo_UPD, ARM::VST4d32_UPD,
false,
true,
true, SingleSpc, 4, 2 ,
true},
483{ ARM::VST4d8Pseudo, ARM::VST4d8,
false,
false,
false, SingleSpc, 4, 8 ,
true},
484{ ARM::VST4d8Pseudo_UPD, ARM::VST4d8_UPD,
false,
true,
true, SingleSpc, 4, 8 ,
true},
486{ ARM::VST4q16Pseudo_UPD, ARM::VST4q16_UPD,
false,
true,
true, EvenDblSpc, 4, 4 ,
true},
487{ ARM::VST4q16oddPseudo, ARM::VST4q16,
false,
false,
false, OddDblSpc, 4, 4 ,
true},
488{ ARM::VST4q16oddPseudo_UPD, ARM::VST4q16_UPD,
false,
true,
true, OddDblSpc, 4, 4 ,
true},
489{ ARM::VST4q32Pseudo_UPD, ARM::VST4q32_UPD,
false,
true,
true, EvenDblSpc, 4, 2 ,
true},
490{ ARM::VST4q32oddPseudo, ARM::VST4q32,
false,
false,
false, OddDblSpc, 4, 2 ,
true},
491{ ARM::VST4q32oddPseudo_UPD, ARM::VST4q32_UPD,
false,
true,
true, OddDblSpc, 4, 2 ,
true},
492{ ARM::VST4q8Pseudo_UPD, ARM::VST4q8_UPD,
false,
true,
true, EvenDblSpc, 4, 8 ,
true},
493{ ARM::VST4q8oddPseudo, ARM::VST4q8,
false,
false,
false, OddDblSpc, 4, 8 ,
true},
494{ ARM::VST4q8oddPseudo_UPD, ARM::VST4q8_UPD,
false,
true,
true, OddDblSpc, 4, 8 ,
true}
502 static std::atomic<bool> TableChecked(
false);
503 if (!TableChecked.load(std::memory_order_relaxed)) {
505 TableChecked.store(
true, std::memory_order_relaxed);
520 unsigned &D1,
unsigned &D2,
unsigned &D3) {
521 if (RegSpc == SingleSpc || RegSpc == SingleLowSpc) {
522 D0 =
TRI->getSubReg(Reg, ARM::dsub_0);
523 D1 =
TRI->getSubReg(Reg, ARM::dsub_1);
524 D2 =
TRI->getSubReg(Reg, ARM::dsub_2);
525 D3 =
TRI->getSubReg(Reg, ARM::dsub_3);
526 }
else if (RegSpc == SingleHighQSpc) {
527 D0 =
TRI->getSubReg(Reg, ARM::dsub_4);
528 D1 =
TRI->getSubReg(Reg, ARM::dsub_5);
529 D2 =
TRI->getSubReg(Reg, ARM::dsub_6);
530 D3 =
TRI->getSubReg(Reg, ARM::dsub_7);
531 }
else if (RegSpc == SingleHighTSpc) {
532 D0 =
TRI->getSubReg(Reg, ARM::dsub_3);
533 D1 =
TRI->getSubReg(Reg, ARM::dsub_4);
534 D2 =
TRI->getSubReg(Reg, ARM::dsub_5);
535 D3 =
TRI->getSubReg(Reg, ARM::dsub_6);
536 }
else if (RegSpc == EvenDblSpc) {
537 D0 =
TRI->getSubReg(Reg, ARM::dsub_0);
538 D1 =
TRI->getSubReg(Reg, ARM::dsub_2);
539 D2 =
TRI->getSubReg(Reg, ARM::dsub_4);
540 D3 =
TRI->getSubReg(Reg, ARM::dsub_6);
542 assert(RegSpc == OddDblSpc &&
"unknown register spacing");
543 D0 =
TRI->getSubReg(Reg, ARM::dsub_1);
544 D1 =
TRI->getSubReg(Reg, ARM::dsub_3);
545 D2 =
TRI->getSubReg(Reg, ARM::dsub_5);
546 D3 =
TRI->getSubReg(Reg, ARM::dsub_7);
559 NEONRegSpacing RegSpc = (NEONRegSpacing)
TableEntry->RegSpacing;
566 bool DstIsDead =
MI.getOperand(OpIdx).isDead();
567 Register DstReg =
MI.getOperand(OpIdx++).getReg();
569 bool IsVLD2DUP =
TableEntry->RealOpc == ARM::VLD2DUPd8x2 ||
572 TableEntry->RealOpc == ARM::VLD2DUPd8x2wb_fixed ||
573 TableEntry->RealOpc == ARM::VLD2DUPd16x2wb_fixed ||
574 TableEntry->RealOpc == ARM::VLD2DUPd32x2wb_fixed ||
575 TableEntry->RealOpc == ARM::VLD2DUPd8x2wb_register ||
576 TableEntry->RealOpc == ARM::VLD2DUPd16x2wb_register ||
577 TableEntry->RealOpc == ARM::VLD2DUPd32x2wb_register;
580 unsigned SubRegIndex;
581 if (RegSpc == EvenDblSpc) {
582 SubRegIndex = ARM::dsub_0;
584 assert(RegSpc == OddDblSpc &&
"Unexpected spacing!");
585 SubRegIndex = ARM::dsub_1;
588 unsigned DstRegPair =
TRI->getMatchingSuperReg(
SubReg, ARM::dsub_0,
589 &ARM::DPairSpcRegClass);
592 unsigned D0, D1, D2, D3;
595 if (NumRegs > 1 &&
TableEntry->copyAllListRegs)
597 if (NumRegs > 2 &&
TableEntry->copyAllListRegs)
599 if (NumRegs > 3 &&
TableEntry->copyAllListRegs)
604 MIB.add(
MI.getOperand(OpIdx++));
607 MIB.add(
MI.getOperand(OpIdx++));
608 MIB.add(
MI.getOperand(OpIdx++));
620 if (
TableEntry->RealOpc == ARM::VLD1d8Qwb_fixed ||
621 TableEntry->RealOpc == ARM::VLD1d16Qwb_fixed ||
622 TableEntry->RealOpc == ARM::VLD1d32Qwb_fixed ||
623 TableEntry->RealOpc == ARM::VLD1d64Qwb_fixed ||
624 TableEntry->RealOpc == ARM::VLD1d8Twb_fixed ||
625 TableEntry->RealOpc == ARM::VLD1d16Twb_fixed ||
626 TableEntry->RealOpc == ARM::VLD1d32Twb_fixed ||
627 TableEntry->RealOpc == ARM::VLD1d64Twb_fixed ||
628 TableEntry->RealOpc == ARM::VLD2DUPd8x2wb_fixed ||
629 TableEntry->RealOpc == ARM::VLD2DUPd16x2wb_fixed ||
630 TableEntry->RealOpc == ARM::VLD2DUPd32x2wb_fixed) {
632 "A fixed writing-back pseudo instruction provides an offset "
642 unsigned SrcOpIdx = 0;
643 if (RegSpc == EvenDblSpc || RegSpc == OddDblSpc || RegSpc == SingleLowSpc ||
644 RegSpc == SingleHighQSpc || RegSpc == SingleHighTSpc)
648 MIB.add(
MI.getOperand(OpIdx++));
649 MIB.add(
MI.getOperand(OpIdx++));
660 MIB.copyImplicitOps(
MI);
663 MIB.cloneMemRefs(
MI);
664 MI.eraseFromParent();
677 NEONRegSpacing RegSpc = (NEONRegSpacing)
TableEntry->RegSpacing;
684 MIB.add(
MI.getOperand(OpIdx++));
687 MIB.add(
MI.getOperand(OpIdx++));
688 MIB.add(
MI.getOperand(OpIdx++));
699 if (
TableEntry->RealOpc == ARM::VST1d8Qwb_fixed ||
700 TableEntry->RealOpc == ARM::VST1d16Qwb_fixed ||
701 TableEntry->RealOpc == ARM::VST1d32Qwb_fixed ||
702 TableEntry->RealOpc == ARM::VST1d64Qwb_fixed ||
703 TableEntry->RealOpc == ARM::VST1d8Twb_fixed ||
704 TableEntry->RealOpc == ARM::VST1d16Twb_fixed ||
705 TableEntry->RealOpc == ARM::VST1d32Twb_fixed ||
706 TableEntry->RealOpc == ARM::VST1d64Twb_fixed) {
708 "A fixed writing-back pseudo instruction provides an offset "
715 bool SrcIsKill =
MI.getOperand(OpIdx).isKill();
716 bool SrcIsUndef =
MI.getOperand(OpIdx).isUndef();
717 Register SrcReg =
MI.getOperand(OpIdx++).getReg();
718 unsigned D0, D1, D2, D3;
721 if (NumRegs > 1 &&
TableEntry->copyAllListRegs)
723 if (NumRegs > 2 &&
TableEntry->copyAllListRegs)
725 if (NumRegs > 3 &&
TableEntry->copyAllListRegs)
729 MIB.add(
MI.getOperand(OpIdx++));
730 MIB.add(
MI.getOperand(OpIdx++));
732 if (SrcIsKill && !SrcIsUndef)
733 MIB->addRegisterKilled(SrcReg,
TRI,
true);
734 else if (!SrcIsUndef)
736 MIB.copyImplicitOps(
MI);
739 MIB.cloneMemRefs(
MI);
740 MI.eraseFromParent();
753 NEONRegSpacing RegSpc = (NEONRegSpacing)
TableEntry->RegSpacing;
762 unsigned Lane =
MI.getOperand(
MI.getDesc().getNumOperands() - 3).getImm();
765 assert(RegSpc != OddDblSpc &&
"unexpected register spacing for VLD/VST-lane");
766 if (RegSpc == EvenDblSpc && Lane >= RegElts) {
770 assert(Lane < RegElts &&
"out of range lane for VLD/VST-lane");
772 unsigned D0 = 0, D1 = 0, D2 = 0, D3 = 0;
774 bool DstIsDead =
false;
776 DstIsDead =
MI.getOperand(OpIdx).isDead();
777 DstReg =
MI.getOperand(OpIdx++).getReg();
789 MIB.add(
MI.getOperand(OpIdx++));
792 MIB.add(
MI.getOperand(OpIdx++));
793 MIB.add(
MI.getOperand(OpIdx++));
796 MIB.add(
MI.getOperand(OpIdx++));
806 MIB.addReg(D0, SrcFlags);
808 MIB.addReg(D1, SrcFlags);
810 MIB.addReg(D2, SrcFlags);
812 MIB.addReg(D3, SrcFlags);
819 MIB.add(
MI.getOperand(OpIdx++));
820 MIB.add(
MI.getOperand(OpIdx++));
828 MIB.copyImplicitOps(
MI);
830 MIB.cloneMemRefs(
MI);
831 MI.eraseFromParent();
837 unsigned Opc,
bool IsExt) {
846 MIB.
add(
MI.getOperand(OpIdx++));
852 bool SrcIsKill =
MI.getOperand(OpIdx).isKill();
853 Register SrcReg =
MI.getOperand(OpIdx++).getReg();
854 unsigned D0, D1, D2, D3;
863 MIB.
add(
MI.getOperand(OpIdx++));
864 MIB.
add(
MI.getOperand(OpIdx++));
869 MI.eraseFromParent();
877 MI.getOpcode() == ARM::MQQPRStore ||
MI.getOpcode() == ARM::MQQQQPRStore
888 MIB.
add(
MI.getOperand(1));
890 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_0), Flags);
891 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_1), Flags);
892 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_2), Flags);
893 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_3), Flags);
894 if (
MI.getOpcode() == ARM::MQQQQPRStore ||
895 MI.getOpcode() == ARM::MQQQQPRLoad) {
896 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_4), Flags);
897 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_5), Flags);
898 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_6), Flags);
899 MIB.
addReg(
TRI->getSubReg(SrcReg, ARM::dsub_7), Flags);
902 if (NewOpc == ARM::VSTMDIA)
907 MI.eraseFromParent();
955 unsigned TargetFlag) {
959 unsigned Imm = MO.
getImm();
960 switch (TargetFlag) {
962 Imm = (Imm >> 24) & 0xff;
965 Imm = (Imm >> 16) & 0xff;
968 Imm = (Imm >> 8) & 0xff;
974 Imm = (Imm >> 16) & 0xffff;
997 bool DstIsDead =
MI.getOperand(0).isDead();
999 unsigned MIFlags =
MI.getFlags();
1008 unsigned PendingShift = 0;
1009 for (
unsigned Byte = 0;
Byte < 4; ++
Byte) {
1015 bool ZeroImm = Operand.
isImm() && Operand.
getImm() == 0;
1016 unsigned Op = PendingShift ? ARM::tADDi8 : ARM::tMOVi8;
1020 if (PendingShift && (!ZeroImm || Byte == 3)) {
1038 if (
Op == ARM::tADDi8)
1048 if (PendingShift || !ZeroImm)
1054 (--
MBBI)->getOperand(0).setIsDead(DstIsDead);
1056 MI.eraseFromParent();
1062 unsigned Opcode =
MI.getOpcode();
1066 bool DstIsDead =
MI.getOperand(0).isDead();
1067 bool isCC = Opcode == ARM::MOVCCi32imm || Opcode == ARM::t2MOVCCi32imm;
1073 if (!STI->hasV6T2Ops() &&
1074 (Opcode == ARM::MOVi32imm || Opcode == ARM::MOVCCi32imm)) {
1076 assert(!STI->isTargetWindows() &&
"Windows on ARM requires ARMv7+");
1078 assert (MO.
isImm() &&
"MOVi32imm w/ non-immediate source operand!");
1080 unsigned SOImmValV1 = 0, SOImmValV2 = 0;
1096 SOImmValV1 = ~(-SOImmValV1);
1099 unsigned MIFlags =
MI.getFlags();
1100 LO16 = LO16.
addImm(SOImmValV1);
1101 HI16 = HI16.
addImm(SOImmValV2);
1112 MI.eraseFromParent();
1116 unsigned LO16Opc = 0;
1117 unsigned HI16Opc = 0;
1118 unsigned MIFlags =
MI.getFlags();
1119 if (Opcode == ARM::t2MOVi32imm || Opcode == ARM::t2MOVCCi32imm) {
1120 LO16Opc = ARM::t2MOVi16;
1121 HI16Opc = ARM::t2MOVTi16;
1123 LO16Opc = ARM::MOVi16;
1124 HI16Opc = ARM::MOVTi16;
1138 if (!(HIOperand.isImm() && HIOperand.getImm() == 0)) {
1143 HI16.
add(HIOperand);
1152 if (RequiresBundling)
1155 MI.eraseFromParent();
1163 const std::initializer_list<unsigned> &Regs,
1167 if (!
Op.isReg() || !
Op.isUse())
1173 std::set_difference(Regs.begin(), Regs.end(), OpRegs.
begin(), OpRegs.
end(),
1174 std::back_inserter(ClearRegs));
1177void ARMExpandPseudo::CMSEClearGPRegs(
1180 unsigned ClobberReg) {
1182 if (STI->hasV8_1MMainlineOps()) {
1186 for (
unsigned R : ClearRegs)
1193 for (
unsigned Reg : ClearRegs) {
1194 if (Reg == ClobberReg)
1202 .
addImm(STI->hasDSP() ? 0xc00 : 0x800)
1221 if ((Reg >= ARM::Q0 && Reg <= ARM::Q7) ||
1222 (Reg >= ARM::D0 && Reg <= ARM::D15) ||
1223 (Reg >= ARM::S0 && Reg <= ARM::S31))
1228 if (Reg >= ARM::Q0 && Reg <= ARM::Q7) {
1229 int R = Reg - ARM::Q0;
1230 ClearRegs.
reset(R * 4, (R + 1) * 4);
1231 }
else if (Reg >= ARM::D0 && Reg <= ARM::D15) {
1232 int R = Reg - ARM::D0;
1233 ClearRegs.
reset(R * 2, (R + 1) * 2);
1234 }
else if (Reg >= ARM::S0 && Reg <= ARM::S31) {
1235 ClearRegs[Reg - ARM::S0] =
false;
1247 if (STI->hasV8_1MMainlineOps())
1248 return CMSEClearFPRegsV81(
MBB,
MBBI, ClearRegs);
1250 return CMSEClearFPRegsV8(
MBB,
MBBI, ClearRegs);
1259 if (!STI->hasFPRegs())
1269 if (STI->hasMinSize()) {
1270 ClearBB = DoneBB = &
MBB;
1291 if (Reg == ARM::NoRegister || Reg == ARM::LR)
1293 assert(
Reg.isPhysical() &&
"Unallocated register");
1317 for (
unsigned D = 0;
D < 8;
D++) {
1319 if (ClearRegs[
D * 2 + 0] && ClearRegs[
D * 2 + 1]) {
1320 unsigned Reg = ARM::D0 +
D;
1327 if (ClearRegs[
D * 2 + 0]) {
1328 unsigned Reg = ARM::S0 +
D * 2;
1334 if (ClearRegs[
D * 2 + 1]) {
1335 unsigned Reg = ARM::S0 +
D * 2 + 1;
1372 int Start = -1,
End = -1;
1373 for (
int S = 0, E = ClearRegs.
size(); S != E; ++S) {
1374 if (ClearRegs[S] && S ==
End + 1) {
1383 while (++Start <=
End)
1394 while (++Start <=
End)
1402void ARMExpandPseudo::CMSESaveClearFPRegs(
1405 if (STI->hasV8_1MMainlineOps())
1406 CMSESaveClearFPRegsV81(
MBB,
MBBI,
DL, LiveRegs);
1407 else if (STI->hasV8MMainlineOps())
1408 CMSESaveClearFPRegsV8(
MBB,
MBBI,
DL, LiveRegs, ScratchRegs);
1412void ARMExpandPseudo::CMSESaveClearFPRegsV8(
1418 unsigned SpareReg = ScratchRegs.
front();
1427 std::vector<std::tuple<unsigned, unsigned, unsigned>> ClearedFPRegs;
1428 std::vector<unsigned> NonclearedFPRegs;
1429 bool ReturnsFPReg =
false;
1431 if (
Op.isReg() &&
Op.isUse()) {
1434 ARM::DPR_VFP2RegClass.
contains(Reg));
1436 if (ARM::DPR_VFP2RegClass.
contains(Reg)) {
1437 if (ScratchRegs.
size() >= 2) {
1440 ClearedFPRegs.emplace_back(Reg, SaveReg1, SaveReg2);
1449 NonclearedFPRegs.push_back(Reg);
1451 }
else if (ARM::SPRRegClass.
contains(Reg)) {
1452 if (ScratchRegs.
size() >= 1) {
1454 ClearedFPRegs.emplace_back(Reg, SaveReg, 0);
1461 NonclearedFPRegs.push_back(Reg);
1464 }
else if (
Op.isReg() &&
Op.isDef()) {
1468 ReturnsFPReg =
true;
1472 bool PassesFPReg = (!NonclearedFPRegs.empty() || !ClearedFPRegs.empty());
1474 if (PassesFPReg || ReturnsFPReg)
1475 assert(STI->hasFPRegs() &&
"Subtarget needs fpregs");
1501 if (ReturnsFPReg && !PassesFPReg) {
1502 bool S0Dead = !LiveRegs.
contains(ARM::S0);
1526 for (
const auto &Regs : ClearedFPRegs) {
1527 unsigned Reg, SaveReg1, SaveReg2;
1528 std::tie(Reg, SaveReg1, SaveReg2) = Regs;
1529 if (ARM::DPR_VFP2RegClass.
contains(Reg))
1534 else if (ARM::SPRRegClass.
contains(Reg))
1540 for (
unsigned Reg : NonclearedFPRegs) {
1541 if (ARM::DPR_VFP2RegClass.
contains(Reg)) {
1542 if (STI->isLittle()) {
1545 .
addImm((Reg - ARM::D0) * 2)
1550 unsigned SReg0 =
TRI->getSubReg(Reg, ARM::ssub_0);
1553 .
addImm((Reg - ARM::D0) * 2)
1557 .
addImm((Reg - ARM::D0) * 2 + 1)
1560 }
else if (ARM::SPRRegClass.
contains(Reg)) {
1603 if (!DefFP && ClearRegs.
count() == ClearRegs.
size()) {
1630 for (
unsigned Reg = ARM::S16;
Reg <= ARM::S31; ++
Reg)
1634 (void)CMSEClearFPRegsV81(
MBB,
MBBI, ClearRegs);
1645void ARMExpandPseudo::CMSERestoreFPRegs(
1648 if (STI->hasV8_1MMainlineOps())
1649 CMSERestoreFPRegsV81(
MBB,
MBBI,
DL, AvailableRegs);
1650 else if (STI->hasV8MMainlineOps())
1651 CMSERestoreFPRegsV8(
MBB,
MBBI,
DL, AvailableRegs);
1654void ARMExpandPseudo::CMSERestoreFPRegsV8(
1659 unsigned ScratchReg = ARM::NoRegister;
1660 if (STI->fixCMSE_CVE_2021_35465())
1664 std::vector<std::tuple<unsigned, unsigned, unsigned>> ClearedFPRegs;
1665 std::vector<unsigned> NonclearedFPRegs;
1667 if (
Op.isReg() &&
Op.isDef()) {
1670 ARM::DPR_VFP2RegClass.
contains(Reg));
1672 if (ARM::DPR_VFP2RegClass.
contains(Reg)) {
1673 if (AvailableRegs.
size() >= 2) {
1676 ClearedFPRegs.emplace_back(Reg, SaveReg1, SaveReg2);
1685 NonclearedFPRegs.push_back(Reg);
1687 }
else if (ARM::SPRRegClass.
contains(Reg)) {
1688 if (AvailableRegs.
size() >= 1) {
1690 ClearedFPRegs.emplace_back(Reg, SaveReg, 0);
1697 NonclearedFPRegs.push_back(Reg);
1703 bool returnsFPReg = (!NonclearedFPRegs.empty() || !ClearedFPRegs.empty());
1706 assert(STI->hasFPRegs() &&
"Subtarget needs fpregs");
1709 for (
unsigned Reg : NonclearedFPRegs) {
1710 if (ARM::DPR_VFP2RegClass.
contains(Reg))
1714 .
addImm((Reg - ARM::D0) * 2)
1716 else if (ARM::SPRRegClass.
contains(Reg))
1733 if (STI->fixCMSE_CVE_2021_35465()) {
1753 if (STI->hasFPRegs())
1766 for (
const auto &Regs : ClearedFPRegs) {
1767 unsigned Reg, SaveReg1, SaveReg2;
1768 std::tie(Reg, SaveReg1, SaveReg2) = Regs;
1769 if (ARM::DPR_VFP2RegClass.
contains(Reg))
1774 else if (ARM::SPRRegClass.
contains(Reg))
1792 if ((Reg >= ARM::Q0 && Reg <= ARM::Q7) ||
1793 (Reg >= ARM::D0 && Reg <= ARM::D15) ||
1794 (Reg >= ARM::S0 && Reg <= ARM::S31))
1800void ARMExpandPseudo::CMSERestoreFPRegsV81(
1804 if (STI->fixCMSE_CVE_2021_35465()) {
1835 for (
unsigned Reg = ARM::S16;
Reg <= ARM::S31; ++
Reg)
1845 unsigned LdrexOp,
unsigned StrexOp,
1848 bool IsThumb = STI->isThumb();
1849 bool IsThumb1Only = STI->isThumb1Only();
1853 Register TempReg =
MI.getOperand(1).getReg();
1856 assert(!
MI.getOperand(2).isUndef() &&
"cannot handle undef");
1857 Register AddrReg =
MI.getOperand(2).getReg();
1858 Register DesiredReg =
MI.getOperand(3).getReg();
1862 assert(STI->hasV8MBaselineOps() &&
1863 "CMP_SWAP not expected to be custom expanded for Thumb1");
1864 assert((UxtOp == 0 || UxtOp == ARM::tUXTB || UxtOp == ARM::tUXTH) &&
1865 "ARMv8-M.baseline does not have t2UXTB/t2UXTH");
1867 "DesiredReg used for UXT op must be tGPR");
1876 MF->
insert(++LoadCmpBB->getIterator(), StoreBB);
1877 MF->
insert(++StoreBB->getIterator(), DoneBB);
1896 if (LdrexOp == ARM::t2LDREX)
1900 unsigned CMPrr = IsThumb ? ARM::tCMPhir : ARM::CMPrr;
1905 unsigned Bcc = IsThumb ? ARM::tBcc : ARM::Bcc;
1910 LoadCmpBB->addSuccessor(DoneBB);
1911 LoadCmpBB->addSuccessor(StoreBB);
1920 if (StrexOp == ARM::t2STREX)
1925 IsThumb ? (IsThumb1Only ? ARM::tCMPi8 : ARM::t2CMPri) : ARM::CMPri;
1934 StoreBB->addSuccessor(LoadCmpBB);
1935 StoreBB->addSuccessor(DoneBB);
1943 MI.eraseFromParent();
1951 StoreBB->clearLiveIns();
1953 LoadCmpBB->clearLiveIns();
1963 unsigned Flags,
bool IsThumb,
1966 Register RegLo =
TRI->getSubReg(Reg.getReg(), ARM::gsub_0);
1967 Register RegHi =
TRI->getSubReg(Reg.getReg(), ARM::gsub_1);
1968 MIB.
addReg(RegLo, Flags);
1969 MIB.
addReg(RegHi, Flags);
1971 MIB.
addReg(Reg.getReg(), Flags);
1978 bool IsThumb = STI->isThumb();
1979 assert(!STI->isThumb1Only() &&
"CMP_SWAP_64 unsupported under Thumb1!");
1985 assert(!
MI.getOperand(1).isUndef() &&
"cannot handle undef");
1986 Register AddrAndTempReg =
MI.getOperand(1).getReg();
1987 Register AddrReg =
TRI->getSubReg(AddrAndTempReg, ARM::gsub_0);
1988 Register TempReg =
TRI->getSubReg(AddrAndTempReg, ARM::gsub_1);
1989 assert(
MI.getOperand(1).getReg() ==
MI.getOperand(2).getReg() &&
1990 "tied operands have different registers");
1991 Register DesiredReg =
MI.getOperand(3).getReg();
1993 New.setIsKill(
false);
1997 Register DesiredLo =
TRI->getSubReg(DesiredReg, ARM::gsub_0);
1998 Register DesiredHi =
TRI->getSubReg(DesiredReg, ARM::gsub_1);
2006 MF->
insert(++LoadCmpBB->getIterator(), StoreBB);
2007 MF->
insert(++StoreBB->getIterator(), DoneBB);
2014 unsigned LDREXD = IsThumb ? ARM::t2LDREXD : ARM::LDREXD;
2020 unsigned CMPrr = IsThumb ? ARM::tCMPhir : ARM::CMPrr;
2031 unsigned Bcc = IsThumb ? ARM::tBcc : ARM::Bcc;
2036 LoadCmpBB->addSuccessor(DoneBB);
2037 LoadCmpBB->addSuccessor(StoreBB);
2043 unsigned STREXD = IsThumb ? ARM::t2STREXD : ARM::STREXD;
2049 unsigned CMPri = IsThumb ? ARM::t2CMPri : ARM::CMPri;
2058 StoreBB->addSuccessor(LoadCmpBB);
2059 StoreBB->addSuccessor(DoneBB);
2067 MI.eraseFromParent();
2075 StoreBB->clearLiveIns();
2077 LoadCmpBB->clearLiveIns();
2092 for (
unsigned Reg = ARM::R4; Reg < ARM::R8; ++Reg) {
2104 for (
unsigned LoReg = ARM::R7, HiReg = ARM::R11; LoReg >= ARM::R4;
2106 if (JumpReg == LoReg)
2115 for (
unsigned Reg = ARM::R4; Reg < ARM::R8; ++Reg) {
2124 if (JumpReg >= ARM::R4 && JumpReg <= ARM::R7) {
2125 Register LoReg = JumpReg == ARM::R4 ? ARM::R5 : ARM::R4;
2138 for (
unsigned Reg = ARM::R4; Reg < ARM::R12; ++Reg) {
2153 for (
int R = 0; R < 4; ++R) {
2161 for (
int R = 0; R < 4; ++R)
2168 for (
unsigned Reg = ARM::R4; Reg < ARM::R12; ++Reg)
2177 unsigned Opcode =
MI.getOpcode();
2185 if (DstReg ==
MI.getOperand(3).getReg()) {
2187 unsigned NewOpc = Opcode == ARM::VBSPd ? ARM::VBITd : ARM::VBITq;
2189 .
add(
MI.getOperand(0))
2190 .
add(
MI.getOperand(3))
2191 .
add(
MI.getOperand(2))
2192 .
add(
MI.getOperand(1))
2194 .
add(
MI.getOperand(5));
2195 }
else if (DstReg ==
MI.getOperand(2).getReg()) {
2197 unsigned NewOpc = Opcode == ARM::VBSPd ? ARM::VBIFd : ARM::VBIFq;
2199 .
add(
MI.getOperand(0))
2200 .
add(
MI.getOperand(2))
2201 .
add(
MI.getOperand(3))
2202 .
add(
MI.getOperand(1))
2204 .
add(
MI.getOperand(5));
2207 unsigned NewOpc = Opcode == ARM::VBSPd ? ARM::VBSLd : ARM::VBSLq;
2208 if (DstReg ==
MI.getOperand(1).getReg()) {
2210 .
add(
MI.getOperand(0))
2211 .
add(
MI.getOperand(1))
2212 .
add(
MI.getOperand(2))
2213 .
add(
MI.getOperand(3))
2215 .
add(
MI.getOperand(5));
2218 unsigned MoveOpc = Opcode == ARM::VBSPd ? ARM::VORRd : ARM::VORRq;
2219 unsigned MO1Flags =
getRegState(
MI.getOperand(1)) & ~RegState::Kill;
2224 .
addReg(
MI.getOperand(1).getReg(), MO1Flags)
2225 .
addReg(
MI.getOperand(1).getReg(), MO1Flags)
2227 .
add(
MI.getOperand(5));
2229 .
add(
MI.getOperand(0))
2233 .
add(
MI.getOperand(2))
2234 .
add(
MI.getOperand(3))
2236 .
add(
MI.getOperand(5));
2239 MI.eraseFromParent();
2243 case ARM::TCRETURNdi:
2244 case ARM::TCRETURNri:
2245 case ARM::TCRETURNrinotr12: {
2247 if (
MBBI->getOpcode() == ARM::SEH_EpilogEnd)
2249 if (
MBBI->getOpcode() == ARM::SEH_Nop_Ret)
2252 "Can only insert epilog into returning blocks");
2253 unsigned RetOpcode =
MBBI->getOpcode();
2260 if (
MBBI->getOpcode() == ARM::SEH_EpilogEnd)
2262 if (
MBBI->getOpcode() == ARM::SEH_Nop_Ret)
2267 if (RetOpcode == ARM::TCRETURNdi) {
2273 ? ((STI->isTargetMachO() || NeedsWinCFI) ? ARM::tTAILJMPd
2289 }
else if (RetOpcode == ARM::TCRETURNri ||
2290 RetOpcode == ARM::TCRETURNrinotr12) {
2292 STI->isThumb() ? ARM::tTAILJMPr
2293 : (STI->hasV4TOps() ? ARM::TAILJMPr : ARM::TAILJMPr4);
2299 auto NewMI = std::prev(
MBBI);
2300 for (
unsigned i = 2, e =
MBBI->getNumOperands(); i != e; ++i)
2301 NewMI->addOperand(
MBBI->getOperand(i));
2305 if (
MI.isCandidateForCallSiteEntry())
2306 MI.getMF()->moveCallSiteInfo(&
MI, &*NewMI);
2315 case ARM::tBXNS_RET: {
2318 if (!STI->hasV8_1MMainlineOps() && AFI->shouldSignReturnAddress())
2323 if (STI->hasV8_1MMainlineOps()) {
2326 TII->get(ARM::VLDR_FPCXTNS_post), ARM::SP)
2331 if (AFI->shouldSignReturnAddress())
2337 return !Op.isReg() || Op.getReg() != ARM::R12;
2341 *
MBBI, {ARM::R0, ARM::R1, ARM::R2, ARM::R3, ARM::R12}, ClearRegs);
2342 CMSEClearGPRegs(AfterBB, AfterBB.
end(),
MBBI->getDebugLoc(), ClearRegs,
2347 TII->get(ARM::tBXNS))
2352 MI.eraseFromParent();
2355 case ARM::tBLXNS_CALL: {
2370 AFI->isThumb1OnlyFunction());
2374 {ARM::R0, ARM::R1, ARM::R2, ARM::R3, ARM::R4,
2375 ARM::R5, ARM::R6, ARM::R7, ARM::R8, ARM::R9,
2376 ARM::R10, ARM::R11, ARM::R12},
2378 auto OriginalClearRegs = ClearRegs;
2382 unsigned ScratchReg = ClearRegs.
front();
2385 if (AFI->isThumb2Function()) {
2406 CMSESaveClearFPRegs(
MBB,
MBBI,
DL, LiveRegs,
2408 CMSEClearGPRegs(
MBB,
MBBI,
DL, ClearRegs, JumpReg);
2417 if (
MI.isCandidateForCallSiteEntry())
2420 CMSERestoreFPRegs(
MBB,
MBBI,
DL, OriginalClearRegs);
2424 MI.eraseFromParent();
2429 case ARM::VMOVDcc: {
2430 unsigned newOpc = Opcode != ARM::VMOVDcc ? ARM::VMOVS : ARM::VMOVD;
2432 MI.getOperand(1).getReg())
2433 .
add(
MI.getOperand(2))
2435 .
add(
MI.getOperand(4))
2438 MI.eraseFromParent();
2443 unsigned Opc = AFI->isThumbFunction() ? ARM::t2MOVr : ARM::MOVr;
2445 MI.getOperand(1).getReg())
2446 .
add(
MI.getOperand(2))
2448 .
add(
MI.getOperand(4))
2452 MI.eraseFromParent();
2455 case ARM::MOVCCsi: {
2457 (
MI.getOperand(1).getReg()))
2458 .
add(
MI.getOperand(2))
2461 .
add(
MI.getOperand(5))
2465 MI.eraseFromParent();
2468 case ARM::MOVCCsr: {
2470 (
MI.getOperand(1).getReg()))
2471 .
add(
MI.getOperand(2))
2472 .
add(
MI.getOperand(3))
2475 .
add(
MI.getOperand(6))
2479 MI.eraseFromParent();
2482 case ARM::t2MOVCCi16:
2483 case ARM::MOVCCi16: {
2484 unsigned NewOpc = AFI->isThumbFunction() ? ARM::t2MOVi16 : ARM::MOVi16;
2486 MI.getOperand(1).getReg())
2489 .
add(
MI.getOperand(4))
2491 MI.eraseFromParent();
2496 unsigned Opc = AFI->isThumbFunction() ? ARM::t2MOVi : ARM::MOVi;
2498 MI.getOperand(1).getReg())
2501 .
add(
MI.getOperand(4))
2505 MI.eraseFromParent();
2510 unsigned Opc = AFI->isThumbFunction() ? ARM::t2MVNi : ARM::MVNi;
2512 MI.getOperand(1).getReg())
2515 .
add(
MI.getOperand(4))
2519 MI.eraseFromParent();
2522 case ARM::t2MOVCClsl:
2523 case ARM::t2MOVCClsr:
2524 case ARM::t2MOVCCasr:
2525 case ARM::t2MOVCCror: {
2528 case ARM::t2MOVCClsl: NewOpc = ARM::t2LSLri;
break;
2529 case ARM::t2MOVCClsr: NewOpc = ARM::t2LSRri;
break;
2530 case ARM::t2MOVCCasr: NewOpc = ARM::t2ASRri;
break;
2531 case ARM::t2MOVCCror: NewOpc = ARM::t2RORri;
break;
2535 MI.getOperand(1).getReg())
2536 .
add(
MI.getOperand(2))
2539 .
add(
MI.getOperand(5))
2542 MI.eraseFromParent();
2545 case ARM::Int_eh_sjlj_dispatchsetup: {
2554 int32_t NumBytes = AFI->getFramePtrSpillOffset();
2557 "base pointer without frame pointer?");
2559 if (AFI->isThumb2Function()) {
2562 }
else if (AFI->isThumbFunction()) {
2571 if (RI.hasStackRealignment(MF)) {
2574 assert (!AFI->isThumb1OnlyFunction());
2577 "The BIC instruction cannot encode "
2578 "immediates larger than 256 with all lower "
2580 unsigned bicOpc = AFI->isThumbFunction() ?
2581 ARM::t2BICri : ARM::BICri;
2589 MI.eraseFromParent();
2597 MI.getOperand(0).getReg())
2598 .
add(
MI.getOperand(1))
2603 MI.eraseFromParent();
2609 MI.getOperand(0).getReg())
2610 .
add(
MI.getOperand(1))
2615 MI.eraseFromParent();
2620 const bool Thumb = Opcode == ARM::tTPsoft;
2624 if (STI->genLongCalls()) {
2626 unsigned PCLabelID = AFI->createPICLabelUId();
2629 "__aeabi_read_tp", PCLabelID, 0);
2633 TII->get(Thumb ? ARM::tLDRpci : ARM::LDRi12), Reg)
2647 TII->get(Thumb ? ARM::tBL : ARM::BL));
2656 if (
MI.isCandidateForCallSiteEntry())
2658 MI.eraseFromParent();
2661 case ARM::tLDRpci_pic:
2662 case ARM::t2LDRpci_pic: {
2663 unsigned NewLdOpc = (Opcode == ARM::tLDRpci_pic)
2664 ? ARM::tLDRpci : ARM::t2LDRpci;
2666 bool DstIsDead =
MI.getOperand(0).isDead();
2668 .
add(
MI.getOperand(1))
2675 .
add(
MI.getOperand(2))
2677 MI.eraseFromParent();
2681 case ARM::LDRLIT_ga_abs:
2682 case ARM::LDRLIT_ga_pcrel:
2683 case ARM::LDRLIT_ga_pcrel_ldr:
2684 case ARM::tLDRLIT_ga_abs:
2685 case ARM::t2LDRLIT_ga_pcrel:
2686 case ARM::tLDRLIT_ga_pcrel: {
2688 bool DstIsDead =
MI.getOperand(0).isDead();
2692 bool IsARM = Opcode != ARM::tLDRLIT_ga_pcrel &&
2693 Opcode != ARM::tLDRLIT_ga_abs &&
2694 Opcode != ARM::t2LDRLIT_ga_pcrel;
2696 Opcode != ARM::LDRLIT_ga_abs && Opcode != ARM::tLDRLIT_ga_abs;
2697 unsigned LDRLITOpc = IsARM ? ARM::LDRi12 : ARM::tLDRpci;
2698 if (Opcode == ARM::t2LDRLIT_ga_pcrel)
2699 LDRLITOpc = ARM::t2LDRpci;
2700 unsigned PICAddOpc =
2702 ? (Opcode == ARM::LDRLIT_ga_pcrel_ldr ? ARM::PICLDR : ARM::PICADD)
2707 unsigned ARMPCLabelIndex = 0;
2711 unsigned PCAdj = IsARM ? 8 : 4;
2715 ARMPCLabelIndex = AFI->createPICLabelUId();
2734 .
addImm(ARMPCLabelIndex);
2740 MI.eraseFromParent();
2743 case ARM::MOV_ga_pcrel:
2744 case ARM::MOV_ga_pcrel_ldr:
2745 case ARM::t2MOV_ga_pcrel: {
2747 unsigned LabelId = AFI->createPICLabelUId();
2749 bool DstIsDead =
MI.getOperand(0).isDead();
2753 bool isARM = Opcode != ARM::t2MOV_ga_pcrel;
2754 unsigned LO16Opc = isARM ? ARM::MOVi16_ga_pcrel : ARM::t2MOVi16_ga_pcrel;
2755 unsigned HI16Opc = isARM ? ARM::MOVTi16_ga_pcrel :ARM::t2MOVTi16_ga_pcrel;
2758 unsigned PICAddOpc = isARM
2759 ? (Opcode == ARM::MOV_ga_pcrel_ldr ? ARM::PICLDR : ARM::PICADD)
2773 TII->get(PICAddOpc))
2778 if (Opcode == ARM::MOV_ga_pcrel_ldr)
2782 MI.eraseFromParent();
2786 case ARM::MOVi32imm:
2787 case ARM::MOVCCi32imm:
2788 case ARM::t2MOVi32imm:
2789 case ARM::t2MOVCCi32imm:
2793 case ARM::tMOVi32imm:
2794 ExpandTMOV32BitImm(
MBB,
MBBI);
2797 case ARM::tLEApcrelJT:
2799 if (
MI.getMF()->getJumpTableInfo()->getEntryKind() ==
2804 assert(STI->isThumb() &&
"Non-inline jump tables expected only in thumb");
2805 ExpandTMOV32BitImm(
MBB,
MBBI);
2808 case ARM::SUBS_PC_LR: {
2811 .
add(
MI.getOperand(0))
2812 .
add(
MI.getOperand(1))
2813 .
add(
MI.getOperand(2))
2816 MI.eraseFromParent();
2819 case ARM::VLDMQIA: {
2820 unsigned NewOpc = ARM::VLDMDIA;
2826 bool DstIsDead =
MI.getOperand(OpIdx).isDead();
2827 Register DstReg =
MI.getOperand(OpIdx++).getReg();
2830 MIB.
add(
MI.getOperand(OpIdx++));
2833 MIB.
add(
MI.getOperand(OpIdx++));
2834 MIB.
add(
MI.getOperand(OpIdx++));
2837 Register D0 =
TRI->getSubReg(DstReg, ARM::dsub_0);
2838 Register D1 =
TRI->getSubReg(DstReg, ARM::dsub_1);
2846 MI.eraseFromParent();
2850 case ARM::VSTMQIA: {
2851 unsigned NewOpc = ARM::VSTMDIA;
2857 bool SrcIsKill =
MI.getOperand(OpIdx).isKill();
2858 Register SrcReg =
MI.getOperand(OpIdx++).getReg();
2865 MIB.
add(
MI.getOperand(OpIdx++));
2866 MIB.
add(
MI.getOperand(OpIdx++));
2869 Register D0 =
TRI->getSubReg(SrcReg, ARM::dsub_0);
2870 Register D1 =
TRI->getSubReg(SrcReg, ARM::dsub_1);
2879 MI.eraseFromParent();
2883 case ARM::VLD2q8Pseudo:
2884 case ARM::VLD2q16Pseudo:
2885 case ARM::VLD2q32Pseudo:
2886 case ARM::VLD2q8PseudoWB_fixed:
2887 case ARM::VLD2q16PseudoWB_fixed:
2888 case ARM::VLD2q32PseudoWB_fixed:
2889 case ARM::VLD2q8PseudoWB_register:
2890 case ARM::VLD2q16PseudoWB_register:
2891 case ARM::VLD2q32PseudoWB_register:
2892 case ARM::VLD3d8Pseudo:
2893 case ARM::VLD3d16Pseudo:
2894 case ARM::VLD3d32Pseudo:
2895 case ARM::VLD1d8TPseudo:
2896 case ARM::VLD1d8TPseudoWB_fixed:
2897 case ARM::VLD1d8TPseudoWB_register:
2898 case ARM::VLD1d16TPseudo:
2899 case ARM::VLD1d16TPseudoWB_fixed:
2900 case ARM::VLD1d16TPseudoWB_register:
2901 case ARM::VLD1d32TPseudo:
2902 case ARM::VLD1d32TPseudoWB_fixed:
2903 case ARM::VLD1d32TPseudoWB_register:
2904 case ARM::VLD1d64TPseudo:
2905 case ARM::VLD1d64TPseudoWB_fixed:
2906 case ARM::VLD1d64TPseudoWB_register:
2907 case ARM::VLD3d8Pseudo_UPD:
2908 case ARM::VLD3d16Pseudo_UPD:
2909 case ARM::VLD3d32Pseudo_UPD:
2910 case ARM::VLD3q8Pseudo_UPD:
2911 case ARM::VLD3q16Pseudo_UPD:
2912 case ARM::VLD3q32Pseudo_UPD:
2913 case ARM::VLD3q8oddPseudo:
2914 case ARM::VLD3q16oddPseudo:
2915 case ARM::VLD3q32oddPseudo:
2916 case ARM::VLD3q8oddPseudo_UPD:
2917 case ARM::VLD3q16oddPseudo_UPD:
2918 case ARM::VLD3q32oddPseudo_UPD:
2919 case ARM::VLD4d8Pseudo:
2920 case ARM::VLD4d16Pseudo:
2921 case ARM::VLD4d32Pseudo:
2922 case ARM::VLD1d8QPseudo:
2923 case ARM::VLD1d8QPseudoWB_fixed:
2924 case ARM::VLD1d8QPseudoWB_register:
2925 case ARM::VLD1d16QPseudo:
2926 case ARM::VLD1d16QPseudoWB_fixed:
2927 case ARM::VLD1d16QPseudoWB_register:
2928 case ARM::VLD1d32QPseudo:
2929 case ARM::VLD1d32QPseudoWB_fixed:
2930 case ARM::VLD1d32QPseudoWB_register:
2931 case ARM::VLD1d64QPseudo:
2932 case ARM::VLD1d64QPseudoWB_fixed:
2933 case ARM::VLD1d64QPseudoWB_register:
2934 case ARM::VLD1q8HighQPseudo:
2935 case ARM::VLD1q8HighQPseudo_UPD:
2936 case ARM::VLD1q8LowQPseudo_UPD:
2937 case ARM::VLD1q8HighTPseudo:
2938 case ARM::VLD1q8HighTPseudo_UPD:
2939 case ARM::VLD1q8LowTPseudo_UPD:
2940 case ARM::VLD1q16HighQPseudo:
2941 case ARM::VLD1q16HighQPseudo_UPD:
2942 case ARM::VLD1q16LowQPseudo_UPD:
2943 case ARM::VLD1q16HighTPseudo:
2944 case ARM::VLD1q16HighTPseudo_UPD:
2945 case ARM::VLD1q16LowTPseudo_UPD:
2946 case ARM::VLD1q32HighQPseudo:
2947 case ARM::VLD1q32HighQPseudo_UPD:
2948 case ARM::VLD1q32LowQPseudo_UPD:
2949 case ARM::VLD1q32HighTPseudo:
2950 case ARM::VLD1q32HighTPseudo_UPD:
2951 case ARM::VLD1q32LowTPseudo_UPD:
2952 case ARM::VLD1q64HighQPseudo:
2953 case ARM::VLD1q64HighQPseudo_UPD:
2954 case ARM::VLD1q64LowQPseudo_UPD:
2955 case ARM::VLD1q64HighTPseudo:
2956 case ARM::VLD1q64HighTPseudo_UPD:
2957 case ARM::VLD1q64LowTPseudo_UPD:
2958 case ARM::VLD4d8Pseudo_UPD:
2959 case ARM::VLD4d16Pseudo_UPD:
2960 case ARM::VLD4d32Pseudo_UPD:
2961 case ARM::VLD4q8Pseudo_UPD:
2962 case ARM::VLD4q16Pseudo_UPD:
2963 case ARM::VLD4q32Pseudo_UPD:
2964 case ARM::VLD4q8oddPseudo:
2965 case ARM::VLD4q16oddPseudo:
2966 case ARM::VLD4q32oddPseudo:
2967 case ARM::VLD4q8oddPseudo_UPD:
2968 case ARM::VLD4q16oddPseudo_UPD:
2969 case ARM::VLD4q32oddPseudo_UPD:
2970 case ARM::VLD3DUPd8Pseudo:
2971 case ARM::VLD3DUPd16Pseudo:
2972 case ARM::VLD3DUPd32Pseudo:
2973 case ARM::VLD3DUPd8Pseudo_UPD:
2974 case ARM::VLD3DUPd16Pseudo_UPD:
2975 case ARM::VLD3DUPd32Pseudo_UPD:
2976 case ARM::VLD4DUPd8Pseudo:
2977 case ARM::VLD4DUPd16Pseudo:
2978 case ARM::VLD4DUPd32Pseudo:
2979 case ARM::VLD4DUPd8Pseudo_UPD:
2980 case ARM::VLD4DUPd16Pseudo_UPD:
2981 case ARM::VLD4DUPd32Pseudo_UPD:
2982 case ARM::VLD2DUPq8EvenPseudo:
2983 case ARM::VLD2DUPq8OddPseudo:
2984 case ARM::VLD2DUPq16EvenPseudo:
2985 case ARM::VLD2DUPq16OddPseudo:
2986 case ARM::VLD2DUPq32EvenPseudo:
2987 case ARM::VLD2DUPq32OddPseudo:
2988 case ARM::VLD2DUPq8OddPseudoWB_fixed:
2989 case ARM::VLD2DUPq8OddPseudoWB_register:
2990 case ARM::VLD2DUPq16OddPseudoWB_fixed:
2991 case ARM::VLD2DUPq16OddPseudoWB_register:
2992 case ARM::VLD2DUPq32OddPseudoWB_fixed:
2993 case ARM::VLD2DUPq32OddPseudoWB_register:
2994 case ARM::VLD3DUPq8EvenPseudo:
2995 case ARM::VLD3DUPq8OddPseudo:
2996 case ARM::VLD3DUPq16EvenPseudo:
2997 case ARM::VLD3DUPq16OddPseudo:
2998 case ARM::VLD3DUPq32EvenPseudo:
2999 case ARM::VLD3DUPq32OddPseudo:
3000 case ARM::VLD3DUPq8OddPseudo_UPD:
3001 case ARM::VLD3DUPq16OddPseudo_UPD:
3002 case ARM::VLD3DUPq32OddPseudo_UPD:
3003 case ARM::VLD4DUPq8EvenPseudo:
3004 case ARM::VLD4DUPq8OddPseudo:
3005 case ARM::VLD4DUPq16EvenPseudo:
3006 case ARM::VLD4DUPq16OddPseudo:
3007 case ARM::VLD4DUPq32EvenPseudo:
3008 case ARM::VLD4DUPq32OddPseudo:
3009 case ARM::VLD4DUPq8OddPseudo_UPD:
3010 case ARM::VLD4DUPq16OddPseudo_UPD:
3011 case ARM::VLD4DUPq32OddPseudo_UPD:
3015 case ARM::VST2q8Pseudo:
3016 case ARM::VST2q16Pseudo:
3017 case ARM::VST2q32Pseudo:
3018 case ARM::VST2q8PseudoWB_fixed:
3019 case ARM::VST2q16PseudoWB_fixed:
3020 case ARM::VST2q32PseudoWB_fixed:
3021 case ARM::VST2q8PseudoWB_register:
3022 case ARM::VST2q16PseudoWB_register:
3023 case ARM::VST2q32PseudoWB_register:
3024 case ARM::VST3d8Pseudo:
3025 case ARM::VST3d16Pseudo:
3026 case ARM::VST3d32Pseudo:
3027 case ARM::VST1d8TPseudo:
3028 case ARM::VST1d8TPseudoWB_fixed:
3029 case ARM::VST1d8TPseudoWB_register:
3030 case ARM::VST1d16TPseudo:
3031 case ARM::VST1d16TPseudoWB_fixed:
3032 case ARM::VST1d16TPseudoWB_register:
3033 case ARM::VST1d32TPseudo:
3034 case ARM::VST1d32TPseudoWB_fixed:
3035 case ARM::VST1d32TPseudoWB_register:
3036 case ARM::VST1d64TPseudo:
3037 case ARM::VST1d64TPseudoWB_fixed:
3038 case ARM::VST1d64TPseudoWB_register:
3039 case ARM::VST3d8Pseudo_UPD:
3040 case ARM::VST3d16Pseudo_UPD:
3041 case ARM::VST3d32Pseudo_UPD:
3042 case ARM::VST3q8Pseudo_UPD:
3043 case ARM::VST3q16Pseudo_UPD:
3044 case ARM::VST3q32Pseudo_UPD:
3045 case ARM::VST3q8oddPseudo:
3046 case ARM::VST3q16oddPseudo:
3047 case ARM::VST3q32oddPseudo:
3048 case ARM::VST3q8oddPseudo_UPD:
3049 case ARM::VST3q16oddPseudo_UPD:
3050 case ARM::VST3q32oddPseudo_UPD:
3051 case ARM::VST4d8Pseudo:
3052 case ARM::VST4d16Pseudo:
3053 case ARM::VST4d32Pseudo:
3054 case ARM::VST1d8QPseudo:
3055 case ARM::VST1d8QPseudoWB_fixed:
3056 case ARM::VST1d8QPseudoWB_register:
3057 case ARM::VST1d16QPseudo:
3058 case ARM::VST1d16QPseudoWB_fixed:
3059 case ARM::VST1d16QPseudoWB_register:
3060 case ARM::VST1d32QPseudo:
3061 case ARM::VST1d32QPseudoWB_fixed:
3062 case ARM::VST1d32QPseudoWB_register:
3063 case ARM::VST1d64QPseudo:
3064 case ARM::VST1d64QPseudoWB_fixed:
3065 case ARM::VST1d64QPseudoWB_register:
3066 case ARM::VST4d8Pseudo_UPD:
3067 case ARM::VST4d16Pseudo_UPD:
3068 case ARM::VST4d32Pseudo_UPD:
3069 case ARM::VST1q8HighQPseudo:
3070 case ARM::VST1q8LowQPseudo_UPD:
3071 case ARM::VST1q8HighTPseudo:
3072 case ARM::VST1q8LowTPseudo_UPD:
3073 case ARM::VST1q16HighQPseudo:
3074 case ARM::VST1q16LowQPseudo_UPD:
3075 case ARM::VST1q16HighTPseudo:
3076 case ARM::VST1q16LowTPseudo_UPD:
3077 case ARM::VST1q32HighQPseudo:
3078 case ARM::VST1q32LowQPseudo_UPD:
3079 case ARM::VST1q32HighTPseudo:
3080 case ARM::VST1q32LowTPseudo_UPD:
3081 case ARM::VST1q64HighQPseudo:
3082 case ARM::VST1q64LowQPseudo_UPD:
3083 case ARM::VST1q64HighTPseudo:
3084 case ARM::VST1q64LowTPseudo_UPD:
3085 case ARM::VST1q8HighTPseudo_UPD:
3086 case ARM::VST1q16HighTPseudo_UPD:
3087 case ARM::VST1q32HighTPseudo_UPD:
3088 case ARM::VST1q64HighTPseudo_UPD:
3089 case ARM::VST1q8HighQPseudo_UPD:
3090 case ARM::VST1q16HighQPseudo_UPD:
3091 case ARM::VST1q32HighQPseudo_UPD:
3092 case ARM::VST1q64HighQPseudo_UPD:
3093 case ARM::VST4q8Pseudo_UPD:
3094 case ARM::VST4q16Pseudo_UPD:
3095 case ARM::VST4q32Pseudo_UPD:
3096 case ARM::VST4q8oddPseudo:
3097 case ARM::VST4q16oddPseudo:
3098 case ARM::VST4q32oddPseudo:
3099 case ARM::VST4q8oddPseudo_UPD:
3100 case ARM::VST4q16oddPseudo_UPD:
3101 case ARM::VST4q32oddPseudo_UPD:
3105 case ARM::VLD1LNq8Pseudo:
3106 case ARM::VLD1LNq16Pseudo:
3107 case ARM::VLD1LNq32Pseudo:
3108 case ARM::VLD1LNq8Pseudo_UPD:
3109 case ARM::VLD1LNq16Pseudo_UPD:
3110 case ARM::VLD1LNq32Pseudo_UPD:
3111 case ARM::VLD2LNd8Pseudo:
3112 case ARM::VLD2LNd16Pseudo:
3113 case ARM::VLD2LNd32Pseudo:
3114 case ARM::VLD2LNq16Pseudo:
3115 case ARM::VLD2LNq32Pseudo:
3116 case ARM::VLD2LNd8Pseudo_UPD:
3117 case ARM::VLD2LNd16Pseudo_UPD:
3118 case ARM::VLD2LNd32Pseudo_UPD:
3119 case ARM::VLD2LNq16Pseudo_UPD:
3120 case ARM::VLD2LNq32Pseudo_UPD:
3121 case ARM::VLD3LNd8Pseudo:
3122 case ARM::VLD3LNd16Pseudo:
3123 case ARM::VLD3LNd32Pseudo:
3124 case ARM::VLD3LNq16Pseudo:
3125 case ARM::VLD3LNq32Pseudo:
3126 case ARM::VLD3LNd8Pseudo_UPD:
3127 case ARM::VLD3LNd16Pseudo_UPD:
3128 case ARM::VLD3LNd32Pseudo_UPD:
3129 case ARM::VLD3LNq16Pseudo_UPD:
3130 case ARM::VLD3LNq32Pseudo_UPD:
3131 case ARM::VLD4LNd8Pseudo:
3132 case ARM::VLD4LNd16Pseudo:
3133 case ARM::VLD4LNd32Pseudo:
3134 case ARM::VLD4LNq16Pseudo:
3135 case ARM::VLD4LNq32Pseudo:
3136 case ARM::VLD4LNd8Pseudo_UPD:
3137 case ARM::VLD4LNd16Pseudo_UPD:
3138 case ARM::VLD4LNd32Pseudo_UPD:
3139 case ARM::VLD4LNq16Pseudo_UPD:
3140 case ARM::VLD4LNq32Pseudo_UPD:
3141 case ARM::VST1LNq8Pseudo:
3142 case ARM::VST1LNq16Pseudo:
3143 case ARM::VST1LNq32Pseudo:
3144 case ARM::VST1LNq8Pseudo_UPD:
3145 case ARM::VST1LNq16Pseudo_UPD:
3146 case ARM::VST1LNq32Pseudo_UPD:
3147 case ARM::VST2LNd8Pseudo:
3148 case ARM::VST2LNd16Pseudo:
3149 case ARM::VST2LNd32Pseudo:
3150 case ARM::VST2LNq16Pseudo:
3151 case ARM::VST2LNq32Pseudo:
3152 case ARM::VST2LNd8Pseudo_UPD:
3153 case ARM::VST2LNd16Pseudo_UPD:
3154 case ARM::VST2LNd32Pseudo_UPD:
3155 case ARM::VST2LNq16Pseudo_UPD:
3156 case ARM::VST2LNq32Pseudo_UPD:
3157 case ARM::VST3LNd8Pseudo:
3158 case ARM::VST3LNd16Pseudo:
3159 case ARM::VST3LNd32Pseudo:
3160 case ARM::VST3LNq16Pseudo:
3161 case ARM::VST3LNq32Pseudo:
3162 case ARM::VST3LNd8Pseudo_UPD:
3163 case ARM::VST3LNd16Pseudo_UPD:
3164 case ARM::VST3LNd32Pseudo_UPD:
3165 case ARM::VST3LNq16Pseudo_UPD:
3166 case ARM::VST3LNq32Pseudo_UPD:
3167 case ARM::VST4LNd8Pseudo:
3168 case ARM::VST4LNd16Pseudo:
3169 case ARM::VST4LNd32Pseudo:
3170 case ARM::VST4LNq16Pseudo:
3171 case ARM::VST4LNq32Pseudo:
3172 case ARM::VST4LNd8Pseudo_UPD:
3173 case ARM::VST4LNd16Pseudo_UPD:
3174 case ARM::VST4LNd32Pseudo_UPD:
3175 case ARM::VST4LNq16Pseudo_UPD:
3176 case ARM::VST4LNq32Pseudo_UPD:
3180 case ARM::VTBL3Pseudo: ExpandVTBL(
MBBI, ARM::VTBL3,
false);
return true;
3181 case ARM::VTBL4Pseudo: ExpandVTBL(
MBBI, ARM::VTBL4,
false);
return true;
3182 case ARM::VTBX3Pseudo: ExpandVTBL(
MBBI, ARM::VTBX3,
true);
return true;
3183 case ARM::VTBX4Pseudo: ExpandVTBL(
MBBI, ARM::VTBX4,
true);
return true;
3185 case ARM::MQQPRLoad:
3186 case ARM::MQQPRStore:
3187 case ARM::MQQQQPRLoad:
3188 case ARM::MQQQQPRStore:
3189 ExpandMQQPRLoadStore(
MBBI);
3192 case ARM::tCMP_SWAP_8:
3194 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::t2LDREXB, ARM::t2STREXB, ARM::tUXTB,
3196 case ARM::tCMP_SWAP_16:
3198 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::t2LDREXH, ARM::t2STREXH, ARM::tUXTH,
3200 case ARM::tCMP_SWAP_32:
3202 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::t2LDREX, ARM::t2STREX, 0, NextMBBI);
3204 case ARM::CMP_SWAP_8:
3206 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::LDREXB, ARM::STREXB, ARM::UXTB,
3208 case ARM::CMP_SWAP_16:
3210 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::LDREXH, ARM::STREXH, ARM::UXTH,
3212 case ARM::CMP_SWAP_32:
3214 return ExpandCMP_SWAP(
MBB,
MBBI, ARM::LDREX, ARM::STREX, 0, NextMBBI);
3216 case ARM::CMP_SWAP_64:
3217 return ExpandCMP_SWAP_64(
MBB,
MBBI, NextMBBI);
3219 case ARM::tBL_PUSHLR:
3220 case ARM::BL_PUSHLR: {
3221 const bool Thumb = Opcode == ARM::tBL_PUSHLR;
3223 assert(Reg == ARM::LR &&
"expect LR register!");
3247 MI.eraseFromParent();
3250 case ARM::t2CALL_BTI: {
3255 for (
unsigned i = 0; i <
MI.getNumOperands(); ++i)
3256 MIB.
add(
MI.getOperand(i));
3257 if (
MI.isCandidateForCallSiteEntry())
3260 Bundler.append(MIB);
3261 Bundler.append(
BuildMI(MF,
MI.getDebugLoc(),
TII->get(ARM::t2BTI)));
3263 MI.eraseFromParent();
3267 case ARM::STOREDUAL: {
3268 Register PairReg =
MI.getOperand(0).getReg();
3272 TII->get(Opcode == ARM::LOADDUAL ? ARM::LDRD : ARM::STRD))
3273 .
addReg(
TRI->getSubReg(PairReg, ARM::gsub_0),
3275 .
addReg(
TRI->getSubReg(PairReg, ARM::gsub_1),
3281 MI.eraseFromParent();
3302 TII = STI->getInstrInfo();
3303 TRI = STI->getRegisterInfo();
3306 LLVM_DEBUG(
dbgs() <<
"********** ARM EXPAND PSEUDO INSTRUCTIONS **********\n"
3307 <<
"********** Function: " << MF.
getName() <<
'\n');
3313 MF.verify(
this,
"After expanding ARM pseudo instructions.");
3315 LLVM_DEBUG(
dbgs() <<
"***************************************************\n");
3322 return new ARMExpandPseudo();
static bool determineFPRegsToClear(const MachineInstr &MI, BitVector &ClearRegs)
static void CMSEPopCalleeSaves(const TargetInstrInfo &TII, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, int JumpReg, bool Thumb1Only)
static MachineOperand getMovOperand(const MachineOperand &MO, unsigned TargetFlag)
static void GetDSubRegs(unsigned Reg, NEONRegSpacing RegSpc, const TargetRegisterInfo *TRI, unsigned &D0, unsigned &D1, unsigned &D2, unsigned &D3)
GetDSubRegs - Get 4 D subregisters of a Q, QQ, or QQQQ register, corresponding to the specified regis...
static MachineOperand makeImplicit(const MachineOperand &MO)
static void addExclusiveRegPair(MachineInstrBuilder &MIB, MachineOperand &Reg, unsigned Flags, bool IsThumb, const TargetRegisterInfo *TRI)
ARM's ldrexd/strexd take a consecutive register pair (represented as a single GPRPair register),...
static cl::opt< bool > VerifyARMPseudo("verify-arm-pseudo-expand", cl::Hidden, cl::desc("Verify machine code after expanding ARM pseudos"))
static bool definesOrUsesFPReg(const MachineInstr &MI)
static void determineGPRegsToClear(const MachineInstr &MI, const std::initializer_list< unsigned > &Regs, SmallVectorImpl< unsigned > &ClearRegs)
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")
#define LLVM_ATTRIBUTE_UNUSED
const HexagonInstrInfo * TII
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
unsigned const TargetRegisterInfo * TRI
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
static const unsigned FramePtr
virtual const ARMBaseRegisterInfo & getRegisterInfo() const =0
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)
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
size_type count() const
count - Returns the number of bits which are set.
size_type size() const
size - Returns the number of bits in this bitvector.
This class represents an Operation in the Expression.
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.
bool needsUnwindTableEntry() const
True if this function needs an unwind table.
A set of physical registers with utility functions to track liveness when walking backward/forward th...
bool contains(MCPhysReg Reg) const
Returns true if register Reg is contained in the set.
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle).
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
bool usesWindowsCFI() const
Helper class for constructing bundles of MachineInstrs.
void transferSuccessors(MachineBasicBlock *FromMBB)
Transfers all the successors from MBB to this machine basic block (i.e., copies all the successors Fr...
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
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.
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 '...
Abstract base class for all machine specific constantpool value subclasses.
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
unsigned getConstantPoolIndex(const Constant *C, Align Alignment)
getConstantPoolIndex - Create a new entry in the constant pool or return an existing one.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Align getMaxAlign() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
virtual MachineFunctionProperties getRequiredProperties() const
Properties which a MachineFunction may have at a given point in time.
MachineFunctionProperties & set(Property P)
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.
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.
void moveCallSiteInfo(const MachineInstr *Old, const MachineInstr *New)
Move the call site info from Old to \New call site info.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *BB=nullptr, std::optional< UniqueBBID > BBID=std::nullopt)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
void insert(iterator MBBI, MachineBasicBlock *MBB)
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned TargetFlags=0) const
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 & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
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.
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
bool addRegisterKilled(Register IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false)
We have determined MI kills a register.
iterator_range< mop_iterator > implicit_operands()
const MachineOperand & getOperand(unsigned i) const
@ EK_Inline
EK_Inline - Jump table entries are emitted inline at their point of use.
MachineOperand class - Representation of each machine instruction operand.
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.
void setIsDead(bool Val=true)
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)
@ 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_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.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - 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.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetFrameLowering * getFrameLowering() const
virtual const TargetInstrInfo * getInstrInfo() const
self_iterator getIterator()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ 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...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
@ Implicit
Not emitted register (e.g. carry, or temporary result).
@ Define
Register definition.
@ Kill
The last use of a register.
@ Undef
Value of the register doesn't matter.
Reg
All possible values of the reg field in the ModR/M byte.
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)
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.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
unsigned getDeadRegState(bool B)
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
void sort(IteratorTy Start, IteratorTy End)
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...
unsigned getUndefRegState(bool B)
unsigned getRegState(const MachineOperand &RegOp)
Get all register state flags from machine operand RegOp.
unsigned getDefRegState(bool B)
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
unsigned getKillRegState(bool B)
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,...
unsigned getRenamableRegState(bool B)
static MachineOperand t1CondCodeOp(bool isDead=false)
Get the operand corresponding to the conditional code result for Thumb1.
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)
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...
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)
This struct is a compact representation of a valid (non-zero power of two) alignment.
uint64_t value() const
This is a hole in the type system and should not be abused.