28 if (FirstMI ==
nullptr)
40 case AArch64::ADDSWri:
41 case AArch64::ADDSWrr:
42 case AArch64::ADDSXri:
43 case AArch64::ADDSXrr:
44 case AArch64::ANDSWri:
45 case AArch64::ANDSWrr:
46 case AArch64::ANDSXri:
47 case AArch64::ANDSXrr:
48 case AArch64::SUBSWri:
49 case AArch64::SUBSWrr:
50 case AArch64::SUBSXri:
51 case AArch64::SUBSXrr:
52 case AArch64::BICSWrr:
53 case AArch64::BICSXrr:
55 case AArch64::ADDSWrs:
56 case AArch64::ADDSXrs:
57 case AArch64::ANDSWrs:
58 case AArch64::ANDSXrs:
59 case AArch64::SUBSWrs:
60 case AArch64::SUBSXrs:
61 case AArch64::BICSWrs:
62 case AArch64::BICSXrs:
64 return !AArch64InstrInfo::hasShiftedReg(*FirstMI);
73 if (SecondMI.
getOpcode() != AArch64::CBZW &&
80 if (FirstMI ==
nullptr)
100 case AArch64::SUBWri:
101 case AArch64::SUBWrr:
102 case AArch64::SUBXri:
103 case AArch64::SUBXrr:
105 case AArch64::ADDWrs:
106 case AArch64::ADDXrs:
107 case AArch64::ANDWrs:
108 case AArch64::ANDXrs:
109 case AArch64::SUBWrs:
110 case AArch64::SUBXrs:
111 case AArch64::BICWrs:
112 case AArch64::BICXrs:
114 return !AArch64InstrInfo::hasShiftedReg(*FirstMI);
126 case AArch64::AESMCrr:
127 case AArch64::AESMCrrTied:
128 return FirstMI ==
nullptr || FirstMI->
getOpcode() == AArch64::AESErr;
130 case AArch64::AESIMCrr:
131 case AArch64::AESIMCrrTied:
132 return FirstMI ==
nullptr || FirstMI->
getOpcode() == AArch64::AESDrr;
141 if (SecondMI.
getOpcode() != AArch64::EORv16i8)
145 if (FirstMI ==
nullptr)
149 case AArch64::AESErr:
150 case AArch64::AESDrr:
151 case AArch64::PMULLv16i8:
152 case AArch64::PMULLv8i8:
153 case AArch64::PMULLv1i64:
154 case AArch64::PMULLv2i64:
164 if ((FirstMI ==
nullptr || FirstMI->
getOpcode() == AArch64::ADRP) &&
175 if ((FirstMI ==
nullptr || FirstMI->
getOpcode() == AArch64::MOVZWi) &&
176 (SecondMI.
getOpcode() == AArch64::MOVKWi &&
181 if((FirstMI ==
nullptr || FirstMI->
getOpcode() == AArch64::MOVZXi) &&
182 (SecondMI.
getOpcode() == AArch64::MOVKXi &&
187 if ((FirstMI ==
nullptr ||
188 (FirstMI->
getOpcode() == AArch64::MOVKXi &&
190 (SecondMI.
getOpcode() == AArch64::MOVKXi &&
201 case AArch64::STRBBui:
202 case AArch64::STRBui:
203 case AArch64::STRDui:
204 case AArch64::STRHHui:
205 case AArch64::STRHui:
206 case AArch64::STRQui:
207 case AArch64::STRSui:
208 case AArch64::STRWui:
209 case AArch64::STRXui:
210 case AArch64::LDRBBui:
211 case AArch64::LDRBui:
212 case AArch64::LDRDui:
213 case AArch64::LDRHHui:
214 case AArch64::LDRHui:
215 case AArch64::LDRQui:
216 case AArch64::LDRSui:
217 case AArch64::LDRWui:
218 case AArch64::LDRXui:
219 case AArch64::LDRSBWui:
220 case AArch64::LDRSBXui:
221 case AArch64::LDRSHWui:
222 case AArch64::LDRSHXui:
223 case AArch64::LDRSWui:
225 if (FirstMI ==
nullptr)
243 if (SecondMI.
getOpcode() == AArch64::CSELWr) {
245 if (FirstMI ==
nullptr)
250 case AArch64::SUBSWrs:
251 return !AArch64InstrInfo::hasShiftedReg(*FirstMI);
252 case AArch64::SUBSWrx:
253 return !AArch64InstrInfo::hasExtendedReg(*FirstMI);
254 case AArch64::SUBSWrr:
255 case AArch64::SUBSWri:
261 if (SecondMI.
getOpcode() == AArch64::CSELXr) {
263 if (FirstMI ==
nullptr)
268 case AArch64::SUBSXrs:
269 return !AArch64InstrInfo::hasShiftedReg(*FirstMI);
270 case AArch64::SUBSXrx:
271 case AArch64::SUBSXrx64:
272 return !AArch64InstrInfo::hasExtendedReg(*FirstMI);
273 case AArch64::SUBSXrr:
274 case AArch64::SUBSXri:
285 if (AArch64InstrInfo::hasShiftedReg(SecondMI))
290 case AArch64::ADDWrr:
291 case AArch64::ADDXrr:
292 case AArch64::SUBWrr:
293 case AArch64::SUBXrr:
294 case AArch64::ADDWrs:
295 case AArch64::ADDXrs:
296 case AArch64::SUBWrs:
297 case AArch64::SUBXrs:
299 case AArch64::ANDWrr:
300 case AArch64::ANDXrr:
301 case AArch64::BICWrr:
302 case AArch64::BICXrr:
303 case AArch64::EONWrr:
304 case AArch64::EONXrr:
305 case AArch64::EORWrr:
306 case AArch64::EORXrr:
307 case AArch64::ORNWrr:
308 case AArch64::ORNXrr:
309 case AArch64::ORRWrr:
310 case AArch64::ORRXrr:
311 case AArch64::ANDWrs:
312 case AArch64::ANDXrs:
313 case AArch64::BICWrs:
314 case AArch64::BICXrs:
315 case AArch64::EONWrs:
316 case AArch64::EONXrs:
317 case AArch64::EORWrs:
318 case AArch64::EORXrs:
319 case AArch64::ORNWrs:
320 case AArch64::ORNXrs:
321 case AArch64::ORRWrs:
322 case AArch64::ORRXrs:
324 if (FirstMI ==
nullptr)
329 case AArch64::ADDWrr:
330 case AArch64::ADDXrr:
331 case AArch64::ADDSWrr:
332 case AArch64::ADDSXrr:
333 case AArch64::SUBWrr:
334 case AArch64::SUBXrr:
335 case AArch64::SUBSWrr:
336 case AArch64::SUBSXrr:
338 case AArch64::ADDWrs:
339 case AArch64::ADDXrs:
340 case AArch64::ADDSWrs:
341 case AArch64::ADDSXrs:
342 case AArch64::SUBWrs:
343 case AArch64::SUBXrs:
344 case AArch64::SUBSWrs:
345 case AArch64::SUBSXrs:
346 return !AArch64InstrInfo::hasShiftedReg(*FirstMI);
351 case AArch64::ADDSWrr:
352 case AArch64::ADDSXrr:
353 case AArch64::SUBSWrr:
354 case AArch64::SUBSXrr:
355 case AArch64::ADDSWrs:
356 case AArch64::ADDSXrs:
357 case AArch64::SUBSWrs:
358 case AArch64::SUBSXrs:
360 if (FirstMI ==
nullptr)
365 case AArch64::ADDWrr:
366 case AArch64::ADDXrr:
367 case AArch64::SUBWrr:
368 case AArch64::SUBXrr:
370 case AArch64::ADDWrs:
371 case AArch64::ADDXrs:
372 case AArch64::SUBWrs:
373 case AArch64::SUBXrs:
374 return !AArch64InstrInfo::hasShiftedReg(*FirstMI);
385 bool NeedsSubtract =
false;
389 case AArch64::SUBWri:
390 case AArch64::SUBXri:
391 NeedsSubtract =
true;
393 case AArch64::ADDWri:
394 case AArch64::ADDXri:
407 if (FirstMI ==
nullptr) {
412 case AArch64::SUBWrs:
413 case AArch64::SUBXrs:
414 if (AArch64InstrInfo::hasShiftedReg(*FirstMI))
417 case AArch64::SUBWrr:
418 case AArch64::SUBXrr:
424 case AArch64::ADDWrs:
425 case AArch64::ADDXrs:
426 if (AArch64InstrInfo::hasShiftedReg(*FirstMI))
429 case AArch64::ADDWrr:
430 case AArch64::ADDXrr:
431 if (!NeedsSubtract) {
451 if (ST.hasCmpBccFusion() || ST.hasArithmeticBccFusion()) {
452 bool CmpOnly = !ST.hasArithmeticBccFusion();
458 if (ST.hasFuseAES() &&
isAESPair(FirstMI, SecondMI))
472 if (ST.hasFuseAddSub2RegAndConstOne() &&
479std::unique_ptr<ScheduleDAGMutation>
static bool isAddSub2RegAndConstOnePair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
static bool isArithmeticBccPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI, bool CmpOnly)
CMN, CMP, TST followed by Bcc.
static bool isAddressLdStPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
Fuse address generation and loads or stores.
static bool isArithmeticCbzPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
ALU operations followed by CBZ/CBNZ.
static bool shouldScheduleAdjacent(const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI)
Check if the instr pair, FirstMI and SecondMI, should be fused together.
static bool isAESPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
AES crypto encoding or decoding.
static bool isAdrpAddPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
static bool isCCSelectPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
Compare and conditional select.
static bool isArithmeticLogicPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
static bool isCryptoEORPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
AESE/AESD/PMULL + EOR.
static bool isLiteralsPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
Literal generation.
const HexagonInstrInfo * TII
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool definesRegister(Register Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr fully defines the specified register.
const MachineOperand & getOperand(unsigned i) const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
Register getReg() const
getReg - Returns the register number.
TargetInstrInfo - Interface to description of machine instruction set.
TargetSubtargetInfo - Generic base class for all target subtargets.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< ScheduleDAGMutation > createMacroFusionDAGMutation(ArrayRef< MacroFusionPredTy > Predicates, bool BranchOnly=false)
Create a DAG scheduling mutation to pair instructions back to back for instructions that benefit acco...
std::unique_ptr< ScheduleDAGMutation > createAArch64MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createAArch64MacroFusionDAGMutation()); to AArch64PassConf...