Lines Matching defs:CopyMI
232 /// src/dst of the copy instruction CopyMI. This returns true if the copy
236 bool joinCopy(MachineInstr *CopyMI, bool &Again,
273 bool adjustCopiesBackFrom(const CoalescerPair &CP, MachineInstr *CopyMI);
289 MachineInstr *CopyMI);
292 bool removePartialRedundancy(const CoalescerPair &CP, MachineInstr &CopyMI);
296 bool reMaterializeTrivialDef(const CoalescerPair &CP, MachineInstr *CopyMI,
319 /// PHI value, it will convert @p CopyMI to an IMPLICIT_DEF.
320 /// Returns nullptr if @p CopyMI was not in any way eliminable. Otherwise,
321 /// it returns @p CopyMI (which could be an IMPLICIT_DEF at this point).
322 MachineInstr *eliminateUndefCopy(MachineInstr *CopyMI);
613 MachineInstr *CopyMI) {
621 SlotIndex CopyIdx = LIS->getInstructionIndex(*CopyMI).getRegSlot();
672 // CopyMI.
675 if (!ValSEndInst || ValSEndInst->getParent() != CopyMI->getParent())
678 // Okay, we now know that ValS ends in the same block that the CopyMI
687 // We are about to delete CopyMI, so need to remove it as the 'instruction
734 CopyMI->substituteRegister(IntA.reg(), IntB.reg(), 0, *TRI);
808 MachineInstr *CopyMI) {
838 SlotIndex CopyIdx = LIS->getInstructionIndex(*CopyMI).getRegSlot();
949 if (UseMI == CopyMI)
1091 MachineInstr &CopyMI) {
1093 if (!CopyMI.isFullCopy())
1096 MachineBasicBlock &MBB = *CopyMI.getParent();
1111 SlotIndex CopyIdx = LIS->getInstructionIndex(CopyMI).getRegSlot(true);
1117 // No B is referenced before CopyMI in MBB.
1163 // reverse copy, CopyMI can be removed trivially if only IntA/IntB is updated.
1164 // If CopyLeftBB is not nullptr, move CopyMI from MBB to CopyLeftBB and
1187 << printMBBReference(*CopyLeftBB) << '\t' << CopyMI);
1190 MachineInstr *NewCopyMI = BuildMI(*CopyLeftBB, InsPos, CopyMI.getDebugLoc(),
1205 << printMBBReference(MBB) << '\t' << CopyMI);
1208 const bool IsUndefCopy = CopyMI.getOperand(1).isUndef();
1210 // Remove CopyMI.
1215 deleteInstr(&CopyMI);
1290 MachineInstr *CopyMI,
1301 SlotIndex CopyIdx = LIS->getInstructionIndex(*CopyMI);
1340 MachineOperand &DstOperand = CopyMI->getOperand(0);
1392 DebugLoc DL = CopyMI->getDebugLoc();
1393 MachineBasicBlock *MBB = CopyMI->getParent();
1395 std::next(MachineBasicBlock::iterator(CopyMI));
1396 Edit.rematerializeAt(*MBB, MII, DstReg, RM, *TRI, false, SrcIdx, CopyMI);
1402 // %1 = copy %0:subreg ; CopyMI, SrcIdx = 0
1433 // CopyMI may have implicit operands, save them so that we can transfer them
1434 // over to the newly materialized instruction after CopyMI is removed.
1436 ImplicitOps.reserve(CopyMI->getNumOperands() -
1437 CopyMI->getDesc().getNumOperands());
1438 for (unsigned I = CopyMI->getDesc().getNumOperands(),
1439 E = CopyMI->getNumOperands();
1441 MachineOperand &MO = CopyMI->getOperand(I);
1452 CopyMI->eraseFromParent();
1453 ErasedInstrs.insert(CopyMI);
1715 MachineInstr *RegisterCoalescer::eliminateUndefCopy(MachineInstr *CopyMI) {
1729 if (!isMoveInstr(*TRI, CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx))
1732 SlotIndex Idx = LIS->getInstructionIndex(*CopyMI);
1734 // CopyMI is undef iff SrcReg is not live before the instruction.
1757 for (unsigned i = CopyMI->getNumOperands(); i != 0; --i) {
1758 MachineOperand &MO = CopyMI->getOperand(i - 1);
1761 CopyMI->removeOperand(i - 1);
1764 CopyMI->getOpcode() == TargetOpcode::SUBREG_TO_REG);
1765 CopyMI->removeOperand(i - 1);
1769 CopyMI->setDesc(TII->get(TargetOpcode::IMPLICIT_DEF));
1772 return CopyMI;
1824 // deleting a def of a subregister may also remove uses. Since CopyMI
1828 for (MachineOperand &MO : CopyMI->all_defs())
1833 return CopyMI;
2018 MachineInstr *CopyMI, bool &Again,
2021 LLVM_DEBUG(dbgs() << LIS->getInstructionIndex(*CopyMI) << '\t' << *CopyMI);
2024 if (!CP.setRegisters(CopyMI)) {
2038 if (!TRI->shouldCoalesce(CopyMI, SrcRC, SrcIdx, DstRC, DstIdx,
2048 if (!CP.isPhys() && CopyMI->allDefsAreDead()) {
2050 DeadDefs.push_back(CopyMI);
2058 if (MachineInstr *UndefMI = eliminateUndefCopy(CopyMI)) {
2061 deleteInstr(CopyMI);
2072 const SlotIndex CopyIdx = LIS->getInstructionIndex(*CopyMI);
2081 MachineBasicBlock *MBB = CopyMI->getParent();
2109 deleteInstr(CopyMI);
2122 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy))
2161 if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy))
2167 bool Changed = adjustCopiesBackFrom(CP, CopyMI);
2170 std::tie(Changed, Shrink) = removeCopyByCommutingDef(CP, CopyMI);
2172 deleteInstr(CopyMI);
2187 if (removePartialRedundancy(CP, *CopyMI))
2208 // CopyMI has been erased by joinIntervals at this point. Remove it from
2211 if (ErasedInstrs.erase(CopyMI))
2213 CurrentErasedInstrs.insert(CopyMI);
2314 MachineInstr *CopyMI;
2323 CopyMI = MRI->getVRegDef(SrcReg);
2324 deleteInstr(CopyMI);
2344 CopyMI = &*MRI->use_instr_nodbg_begin(SrcReg);
2345 SlotIndex CopyRegIdx = LIS->getInstructionIndex(*CopyMI).getRegSlot();
2369 deleteInstr(CopyMI);