Lines Matching refs:Last
236 int calcInstrDist(const MachineInstr &First, const MachineInstr &Last);
256 bool isReplaceable(const MachineInstr &First, const MachineInstr &Last,
284 const MachineInstr &Last) { in calcInstrDist() argument
287 assert(Last.getParent() == First.getParent() && in calcInstrDist()
290 InstrPos.find(&Last) != InstrPos.end() && in calcInstrDist()
293 return InstrPos[&Last] - InstrPos[&First]; in calcInstrDist()
389 const MachineInstr &Last, in isReplaceable() argument
391 assert(isLEA(First) && isLEA(Last) && in isReplaceable()
395 AddrDispShift = getAddrDispShift(Last, 1, First, 1); in isReplaceable()
402 MRI->getRegClass(Last.getOperand(0).getReg())) in isReplaceable()
408 for (auto &MO : MRI->use_operands(Last.getOperand(0).getReg())) { in isReplaceable()
551 MachineInstr &Last = **I2; in removeRedundantLEAs() local
556 assert(calcInstrDist(First, Last) > 0 && in removeRedundantLEAs()
560 if (!isReplaceable(First, Last, AddrDispShift)) { in removeRedundantLEAs()
568 for (auto UI = MRI->use_begin(Last.getOperand(0).getReg()), in removeRedundantLEAs()
595 DEBUG(dbgs() << "OptimizeLEAs: Remove redundant LEA: "; Last.dump();); in removeRedundantLEAs()
599 assert(MRI->use_empty(Last.getOperand(0).getReg()) && in removeRedundantLEAs()
601 Last.eraseFromParent(); in removeRedundantLEAs()