Lines Matching refs:Def
257 static bool shouldRematerialize(const MachineInstr &Def, in shouldRematerialize() argument
259 return Def.isAsCheapAsAMove() && TII->isTriviallyReMaterializable(Def); in shouldRematerialize()
269 if (MachineInstr *Def = MRI.getUniqueVRegDef(Reg)) in getVRegDef() local
270 return Def; in getVRegDef()
283 static bool hasOneUse(unsigned Reg, MachineInstr *Def, MachineRegisterInfo &MRI, in hasOneUse() argument
292 LI.getVNInfoAt(LIS.getInstructionIndex(*Def).getRegSlot()); in hasOneUse()
312 static bool isSafeToMove(const MachineOperand *Def, const MachineOperand *Use, in isSafeToMove() argument
316 const MachineInstr *DefI = Def->getParent(); in isSafeToMove()
332 if (Def != DefI->defs().begin()) in isSafeToMove()
517 MachineInstr *Def, MachineBasicBlock &MBB, in moveForSingleUse() argument
521 LLVM_DEBUG(dbgs() << "Move for single use: "; Def->dump()); in moveForSingleUse()
523 WebAssemblyDebugValueManager DefDIs(Def); in moveForSingleUse()
524 MBB.splice(Insert, &MBB, Def); in moveForSingleUse()
526 LIS.handleMove(*Def); in moveForSingleUse()
536 Def->getOperand(0).setReg(NewReg); in moveForSingleUse()
544 LI.removeSegment(LIS.getInstructionIndex(*Def).getRegSlot(), in moveForSingleUse()
552 LLVM_DEBUG(dbgs() << " - Replaced register: "; Def->dump()); in moveForSingleUse()
555 imposeStackOrdering(Def); in moveForSingleUse()
556 return Def; in moveForSingleUse()
562 unsigned Reg, MachineOperand &Op, MachineInstr &Def, MachineBasicBlock &MBB, in rematerializeCheapDef() argument
566 LLVM_DEBUG(dbgs() << "Rematerializing cheap def: "; Def.dump()); in rematerializeCheapDef()
569 WebAssemblyDebugValueManager DefDIs(&Def); in rematerializeCheapDef()
572 TII->reMaterialize(MBB, Insert, NewReg, 0, Def, *TRI); in rematerializeCheapDef()
587 IsDead = !LI.liveAt(LIS.getInstructionIndex(Def).getDeadSlot()); in rematerializeCheapDef()
594 SlotIndex Idx = LIS.getInstructionIndex(Def).getRegSlot(); in rematerializeCheapDef()
597 LIS.RemoveMachineInstrFromMaps(Def); in rematerializeCheapDef()
598 Def.eraseFromParent(); in rematerializeCheapDef()
630 unsigned Reg, MachineOperand &Op, MachineInstr *Def, MachineBasicBlock &MBB, in moveAndTeeForMultiUse() argument
633 LLVM_DEBUG(dbgs() << "Move and tee for multi-use:"; Def->dump()); in moveAndTeeForMultiUse()
635 WebAssemblyDebugValueManager DefDIs(Def); in moveAndTeeForMultiUse()
638 MBB.splice(Insert, &MBB, Def); in moveAndTeeForMultiUse()
639 LIS.handleMove(*Def); in moveAndTeeForMultiUse()
645 MachineOperand &DefMO = Def->getOperand(0); in moveAndTeeForMultiUse()
653 SlotIndex DefIdx = LIS.getInstructionIndex(*Def).getRegSlot(); in moveAndTeeForMultiUse()
670 imposeStackOrdering(Def); in moveAndTeeForMultiUse()
676 LLVM_DEBUG(dbgs() << " - Replaced register: "; Def->dump()); in moveAndTeeForMultiUse()
678 return Def; in moveAndTeeForMultiUse()
863 MachineOperand *Def = DefI->findRegisterDefOperand(Reg); in runOnMachineFunction() local
864 assert(Def != nullptr); in runOnMachineFunction()
873 bool CanMove = SameBlock && isSafeToMove(Def, &Use, Insert, MFI, MRI) && in runOnMachineFunction()