24 static bool isArithmeticBccPair(
const MachineInstr *FirstMI,
26 if (SecondMI.
getOpcode() == AArch64::Bcc) {
32 case AArch64::ADDSWri:
33 case AArch64::ADDSWrr:
34 case AArch64::ADDSXri:
35 case AArch64::ADDSXrr:
36 case AArch64::ANDSWri:
37 case AArch64::ANDSWrr:
38 case AArch64::ANDSXri:
39 case AArch64::ANDSXrr:
40 case AArch64::SUBSWri:
41 case AArch64::SUBSWrr:
42 case AArch64::SUBSXri:
43 case AArch64::SUBSXrr:
44 case AArch64::BICSWrr:
45 case AArch64::BICSXrr:
47 case AArch64::ADDSWrs:
48 case AArch64::ADDSXrs:
49 case AArch64::ANDSWrs:
50 case AArch64::ANDSXrs:
51 case AArch64::SUBSWrs:
52 case AArch64::SUBSXrs:
53 case AArch64::BICSWrs:
54 case AArch64::BICSXrs:
63 static bool isArithmeticCbzPair(
const MachineInstr *FirstMI,
65 unsigned SecondOpcode = SecondMI.
getOpcode();
67 if (SecondOpcode == AArch64::CBNZW || SecondOpcode == AArch64::CBNZX ||
68 SecondOpcode == AArch64::CBZW || SecondOpcode == AArch64::CBZX) {
100 case AArch64::SUBXrs:
101 case AArch64::BICWrs:
102 case AArch64::BICXrs:
114 unsigned FirstOpcode =
116 :
static_cast<unsigned>(AArch64::INSTRUCTION_LIST_END);
117 unsigned SecondOpcode = SecondMI.
getOpcode();
120 if ((FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
121 FirstOpcode == AArch64::AESErr) &&
122 (SecondOpcode == AArch64::AESMCrr ||
123 SecondOpcode == AArch64::AESMCrrTied))
126 else if ((FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
127 FirstOpcode == AArch64::AESDrr) &&
128 (SecondOpcode == AArch64::AESIMCrr ||
129 SecondOpcode == AArch64::AESIMCrrTied))
139 unsigned FirstOpcode =
141 :
static_cast<unsigned>(AArch64::INSTRUCTION_LIST_END);
142 unsigned SecondOpcode = SecondMI.
getOpcode();
145 if ((FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
147 SecondOpcode == AArch64::ADDXri)
150 else if ((FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
151 FirstOpcode == AArch64::MOVZWi) &&
152 (SecondOpcode == AArch64::MOVKWi &&
156 else if((FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
157 FirstOpcode == AArch64::MOVZXi) &&
158 (SecondOpcode == AArch64::MOVKXi &&
162 else if ((FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
163 (FirstOpcode == AArch64::MOVKXi &&
165 (SecondOpcode == AArch64::MOVKXi &&
173 static bool isAddressLdStPair(
const MachineInstr *FirstMI,
175 unsigned SecondOpcode = SecondMI.
getOpcode();
177 switch (SecondOpcode) {
178 case AArch64::STRBBui:
179 case AArch64::STRBui:
180 case AArch64::STRDui:
181 case AArch64::STRHHui:
182 case AArch64::STRHui:
183 case AArch64::STRQui:
184 case AArch64::STRSui:
185 case AArch64::STRWui:
186 case AArch64::STRXui:
187 case AArch64::LDRBBui:
188 case AArch64::LDRBui:
189 case AArch64::LDRDui:
190 case AArch64::LDRHHui:
191 case AArch64::LDRHui:
192 case AArch64::LDRQui:
193 case AArch64::LDRSui:
194 case AArch64::LDRWui:
195 case AArch64::LDRXui:
196 case AArch64::LDRSBWui:
197 case AArch64::LDRSBXui:
198 case AArch64::LDRSHWui:
199 case AArch64::LDRSHXui:
200 case AArch64::LDRSWui:
218 unsigned SecondOpcode = SecondMI.
getOpcode();
221 if (SecondOpcode == AArch64::CSELWr) {
228 case AArch64::SUBSWrs:
230 case AArch64::SUBSWrx:
232 case AArch64::SUBSWrr:
233 case AArch64::SUBSWri:
238 else if (SecondOpcode == AArch64::CSELXr) {
245 case AArch64::SUBSXrs:
247 case AArch64::SUBSXrx:
248 case AArch64::SUBSXrx64:
250 case AArch64::SUBSXrr:
251 case AArch64::SUBSXri:
Compute iterated dominance frontiers using a linear time algorithm.
static bool hasShiftedReg(const MachineInstr &MI)
Returns true if there is a shiftable register and that the shift value is non-zero.
static bool isAESPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
bool hasFuseLiterals() const
const HexagonInstrInfo * TII
bool hasArithmeticBccFusion() const
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
std::unique_ptr< ScheduleDAGMutation > createMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent)
Create a DAG scheduling mutation to pair instructions back to back for instructions that benefit acco...
bool hasFuseAddress() const
TargetInstrInfo - Interface to description of machine instruction set.
static bool isLiteralsPair(const MachineInstr *FirstMI, const MachineInstr &SecondMI)
bool definesRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr fully defines the specified register.
std::unique_ptr< ScheduleDAGMutation > createAArch64MacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createAArch64MacroFusionDAGMutation()); to AArch64PassConf...
static bool hasExtendedReg(const MachineInstr &MI)
Returns true if there is an extendable register and that the extending value is non-zero.
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.
bool hasArithmeticCbzFusion() const
TargetSubtargetInfo - Generic base class for all target subtargets.
Representation of each machine instruction.
bool hasFuseCCSelect() const
const MachineOperand & getOperand(unsigned i) const