Lines Matching refs:Def
24 WebAssemblyDebugValueManager::WebAssemblyDebugValueManager(MachineInstr *Def)
25 : Def(Def) {
26 if (!Def->getMF()->getFunction().getSubprogram())
32 if (!Def->getOperand(0).isReg())
34 CurrentReg = Def->getOperand(0).getReg();
36 for (MachineBasicBlock::iterator MI = std::next(Def->getIterator()),
37 ME = Def->getParent()->end();
67 // DBG_VALUEs between Def and Insert
70 if (Def->getParent() == Insert->getParent()) {
71 // When Def and Insert are within the same BB, check if Insert comes after
72 // Def, because we only support sinking.
74 for (MachineBasicBlock::iterator MI = std::next(Def->getIterator()),
75 ME = Def->getParent()->end();
87 } else { // Def and Insert are in different BBs
88 // If Def and Insert are in different BBs, we only handle a simple case in
89 // which Insert's BB is a successor of Def's BB.
90 if (!Def->getParent()->isSuccessor(Insert->getParent()))
93 // Gather DBG_VALUEs between 'Def~Def BB's end' and
95 for (MachineBasicBlock::iterator MI = std::next(Def->getIterator()),
96 ME = Def->getParent()->end();
109 // Gather DebugVariables that are seen between Def and Insert, excluding our
122 // another DBG_VALUE between Def and Insert referring to the same
131 MachineRegisterInfo &MRI = Def->getParent()->getParent()->getRegInfo();
140 if (!WebAssembly::isScalarConst(Def->getOpcode()))
207 if (!OtherDef || !isSameScalarConst(Def, OtherDef)) {
219 // Following DBG_VALUEs for 'Def' are ignored.
222 if (Def->getParent() != Insert->getParent())
224 for (MachineBasicBlock::iterator MI = std::next(Def->getIterator()),
243 // Sink 'Def', and also sink its eligible DBG_VALUEs to the place before
246 // For DBG_VALUEs to sink properly, if 'Def' and 'Insert' are within the same
247 // BB, 'Insert' should be below 'Def'; if they are in different BBs, 'Insert'
248 // should be in one of 'Def's BBs successors. Def will be sunk regardless of the
251 // This DebugValueManager's new Def and DbgValues will be updated to the newly
252 // sinked Def + DBG_VALUEs.
254 // In case Def is requested to be sunk to
258 // %0 = someinst // Def
265 // %0 = someinst // Def
275 // Def, because we need to examine instructions between Def and Insert.
279 // Sink Def first.
284 if (Def->getParent() != MBB && !hasSameDebugLoc(MBB, Def->getDebugLoc()))
285 Def->setDebugLoc(DebugLoc());
286 MBB->splice(Insert, Def->getParent(), Def);
299 // When sinking a Def and its DBG_VALUEs, we shouldn't just remove the
344 // Clone 'Def', and also clone its eligible DBG_VALUEs to the place before
347 // For DBG_VALUEs to be cloned properly, if 'Def' and 'Insert' are within the
348 // same BB, 'Insert' should be below 'Def'; if they are in different BBs,
349 // 'Insert' should be in one of 'Def's BBs successors. Def will be cloned
363 // Clone Def first.
365 MachineInstr *Clone = MF->CloneMachineInstr(Def);
369 if (Def->getParent() != MBB && !hasSameDebugLoc(MBB, Def->getDebugLoc()))
393 // Update the register for Def and DBG_VALUEs.
400 Def->getOperand(0).setReg(Reg);
414 // Remove Def, and set its DBG_VALUEs to undef.
416 Def->removeFromParent();