Lines Matching defs:I1
83 MachineInstr *findPairable(MachineInstr *I1, bool &DoInsertAtI1);
87 void combine(MachineInstr *I1, MachineInstr *I2,
90 bool isSafeToMoveTogether(MachineInstr *I1, MachineInstr *I2,
232 /// isSafeToMoveTogether - Returns true if it is safe to move I1 next to I2 such
234 bool HexagonCopyToCombine::isSafeToMoveTogether(MachineInstr *I1,
243 // It is not safe to move I1 and I2 into one combine if I2 has a true
244 // dependence on I1.
245 if (I2UseReg && I1->modifiesRegister(I2UseReg, TRI))
250 // First try to move I2 towards I1.
252 // A reverse_iterator instantiated like below starts before I2, and I1
254 // Look at instructions I in between I2 and (excluding) I1.
256 End = --(MachineBasicBlock::reverse_iterator(I1));
259 End = MachineBasicBlock::reverse_iterator(I1);
298 // Try to move I1 towards I2.
300 // Look at instructions I in between I1 and (excluding) I2.
301 MachineBasicBlock::iterator I(I1), End(I2);
305 IsImmUseReg = I1->getOperand(1).isImm() || I1->getOperand(1).isGlobal();
306 unsigned I1UseReg = IsImmUseReg ? 0 : I1->getOperand(1).getReg();
308 // operand, we need to update the kill information on the moved I1. It kills
315 // * modifies I1's use reg
316 // * modifies I1's def reg
317 // * reads I1's def reg
322 // * or has a killed aliased register use of I1's use reg
329 // we can't move I1 across it.
344 // Update I1 to set the kill flag. This flag will later be picked up by
346 bool Added = I1->addRegisterKilled(KilledOperand, TRI);
437 I1 = MI++;
441 if (ShouldCombineAggressively && PotentiallyNewifiableTFR.count(I1))
445 if (!isCombinableInstType(I1, TII, ShouldCombineAggressively))
451 MachineInstr *I2 = findPairable(I1, DoInsertAtI1);
454 combine(I1, I2, MI, DoInsertAtI1);
462 /// findPairable - Returns an instruction that can be merged with \p I1 into a
464 /// in \p DoInsertAtI1 if the combine must be inserted at instruction \p I1
466 MachineInstr *HexagonCopyToCombine::findPairable(MachineInstr *I1,
468 MachineBasicBlock::iterator I2 = llvm::next(MachineBasicBlock::iterator(I1));
469 unsigned I1DestReg = I1->getOperand(0).getReg();
471 for (MachineBasicBlock::iterator End = I1->getParent()->end(); I2 != End;
499 if ((IsI2LowReg && !areCombinableOperations(TRI, I1, I2)) ||
500 (IsI1LowReg && !areCombinableOperations(TRI, I2, I1)))
503 if (isSafeToMoveTogether(I1, I2, I1DestReg, I2DestReg,
513 void HexagonCopyToCombine::combine(MachineInstr *I1, MachineInstr *I2,
520 // Figure out whether I1 or I2 goes into the lowreg part.
521 unsigned I1DestReg = I1->getOperand(0).getReg();
534 MachineOperand &LoOperand = IsI1Loreg ? I1->getOperand(1) :
537 I1->getOperand(1);
543 MachineBasicBlock::iterator InsertPt(DoInsertAtI1 ? I1 : I2);
554 I1->eraseFromParent();