Lines Matching defs:Last
263 int calcInstrDist(const MachineInstr &First, const MachineInstr &Last);
279 /// Returns true if the \p Last LEA instruction can be replaced by the
282 /// replacement of the \p Last LEA's uses with the \p First's def register.
283 bool isReplaceable(const MachineInstr &First, const MachineInstr &Last,
319 const MachineInstr &Last) {
322 assert(Last.getParent() == First.getParent() &&
324 assert(InstrPos.contains(&First) && InstrPos.contains(&Last) &&
327 return InstrPos[&Last] - InstrPos[&First];
416 // Check that the Last LEA can be replaced by the First LEA. To be so,
420 // 3) All uses of the Last LEA def register are replaceable, thus the
423 const MachineInstr &Last,
425 assert(isLEA(First) && isLEA(Last) &&
433 MRI->getRegClass(Last.getOperand(0).getReg()))
437 AddrDispShift = getAddrDispShift(Last, 1, First, 1);
439 // Loop over all uses of the Last LEA to check that its def register is
442 for (auto &MO : MRI->use_nodbg_operands(Last.getOperand(0).getReg())) {
635 MachineInstr &Last = **I2;
640 assert(calcInstrDist(First, Last) > 0 &&
643 // Check that the Last LEA instruction can be replaced by the First.
644 if (!isReplaceable(First, Last, AddrDispShift)) {
649 // Loop over all uses of the Last LEA and update their operands. Note
653 Register LastVReg = Last.getOperand(0).getReg();
692 Last.dump(););
694 // By this moment, all of the Last LEA's uses must be replaced. So we
698 Last.eraseFromParent();