Lines Matching refs:OldMI
90 bool changeStore(MachineInstr *OldMI, MachineOperand ImmOp,
92 bool changeLoad(MachineInstr *OldMI, MachineOperand ImmOp, unsigned ImmOpNum);
304 bool HexagonOptAddrMode::changeLoad(MachineInstr *OldMI, MachineOperand ImmOp, in changeLoad() argument
307 MachineBasicBlock *BB = OldMI->getParent(); in changeLoad()
308 auto UsePos = MachineBasicBlock::iterator(OldMI); in changeLoad()
312 unsigned OpEnd = OldMI->getNumOperands(); in changeLoad()
316 if (HII->getAddrMode(OldMI) == HexagonII::BaseRegOffset) { in changeLoad()
317 short NewOpCode = HII->getBaseWithLongOffset(OldMI); in changeLoad()
319 MIB = BuildMI(*BB, InsertPt, OldMI->getDebugLoc(), HII->get(NewOpCode)); in changeLoad()
320 MIB.addOperand(OldMI->getOperand(0)); in changeLoad()
321 MIB.addOperand(OldMI->getOperand(2)); in changeLoad()
322 MIB.addOperand(OldMI->getOperand(3)); in changeLoad()
326 } else if (HII->getAddrMode(OldMI) == HexagonII::BaseImmOffset) { in changeLoad()
327 short NewOpCode = HII->getAbsoluteForm(OldMI); in changeLoad()
329 MIB = BuildMI(*BB, InsertPt, OldMI->getDebugLoc(), HII->get(NewOpCode)) in changeLoad()
330 .addOperand(OldMI->getOperand(0)); in changeLoad()
332 int64_t Offset = ImmOp.getOffset() + OldMI->getOperand(2).getImm(); in changeLoad()
340 DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n"); in changeLoad()
342 } else if (ImmOpNum == 2 && OldMI->getOperand(3).getImm() == 0) { in changeLoad()
343 short NewOpCode = HII->xformRegToImmOffset(OldMI); in changeLoad()
345 MIB = BuildMI(*BB, InsertPt, OldMI->getDebugLoc(), HII->get(NewOpCode)); in changeLoad()
346 MIB.addOperand(OldMI->getOperand(0)); in changeLoad()
347 MIB.addOperand(OldMI->getOperand(1)); in changeLoad()
351 DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n"); in changeLoad()
357 MIB.addOperand(OldMI->getOperand(i)); in changeLoad()
362 bool HexagonOptAddrMode::changeStore(MachineInstr *OldMI, MachineOperand ImmOp, in changeStore() argument
366 unsigned OpEnd = OldMI->getNumOperands(); in changeStore()
367 MachineBasicBlock *BB = OldMI->getParent(); in changeStore()
368 auto UsePos = MachineBasicBlock::iterator(OldMI); in changeStore()
373 if (HII->getAddrMode(OldMI) == HexagonII::BaseRegOffset) { in changeStore()
374 short NewOpCode = HII->getBaseWithLongOffset(OldMI); in changeStore()
376 MIB = BuildMI(*BB, InsertPt, OldMI->getDebugLoc(), HII->get(NewOpCode)); in changeStore()
377 MIB.addOperand(OldMI->getOperand(1)); in changeStore()
378 MIB.addOperand(OldMI->getOperand(2)); in changeStore()
380 MIB.addOperand(OldMI->getOperand(3)); in changeStore()
382 } else if (HII->getAddrMode(OldMI) == HexagonII::BaseImmOffset) { in changeStore()
383 short NewOpCode = HII->getAbsoluteForm(OldMI); in changeStore()
385 MIB = BuildMI(*BB, InsertPt, OldMI->getDebugLoc(), HII->get(NewOpCode)); in changeStore()
387 int64_t Offset = ImmOp.getOffset() + OldMI->getOperand(1).getImm(); in changeStore()
389 MIB.addOperand(OldMI->getOperand(2)); in changeStore()
393 DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n"); in changeStore()
395 } else if (ImmOpNum == 1 && OldMI->getOperand(2).getImm() == 0) { in changeStore()
396 short NewOpCode = HII->xformRegToImmOffset(OldMI); in changeStore()
398 MIB = BuildMI(*BB, InsertPt, OldMI->getDebugLoc(), HII->get(NewOpCode)); in changeStore()
399 MIB.addOperand(OldMI->getOperand(0)); in changeStore()
401 MIB.addOperand(OldMI->getOperand(1)); in changeStore()
404 DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n"); in changeStore()
409 MIB.addOperand(OldMI->getOperand(i)); in changeStore()