Lines Matching refs:UseMI
32 MachineInstr *UseMI; member
46 UseMI(MI), OpToFold(nullptr), ShrinkOpcode(ShrinkOp), UseOpNo(OpNo), in FoldCandidate()
93 MachineInstr *UseMI,
133 const MachineInstr &UseMI, in isInlineConstantIfFolded() argument
136 if (TII->isInlineConstant(UseMI, OpNo, OpToFold)) in isInlineConstantIfFolded()
139 unsigned Opc = UseMI.getOpcode(); in isInlineConstantIfFolded()
170 MachineInstr *MI = Fold.UseMI; in updateOperand()
275 if (Candidate.UseMI == MI) in isUseMIInFoldList()
398 MachineInstr *UseMI, in foldOperand() argument
402 const MachineOperand &UseOp = UseMI->getOperand(UseOpIdx); in foldOperand()
404 if (!isUseSafeToFold(TII, *UseMI, UseOp)) in foldOperand()
428 if (UseMI->isRegSequence()) { in foldOperand()
429 unsigned RegSeqDstReg = UseMI->getOperand(0).getReg(); in foldOperand()
430 unsigned RegSeqDstSubReg = UseMI->getOperand(UseOpIdx + 1).getImm(); in foldOperand()
450 if (FoldingImm && UseMI->isCopy()) { in foldOperand()
451 unsigned DestReg = UseMI->getOperand(0).getReg(); in foldOperand()
457 unsigned SrcReg = UseMI->getOperand(1).getReg(); in foldOperand()
469 Use.getOperandNo(), &UseMI->getOperand(1)); in foldOperand()
473 foldOperand(*F.OpToFold, F.UseMI, F.UseOpNo, in foldOperand()
486 UseMI->setDesc(TII->get(MovOp)); in foldOperand()
487 CopiesToReplace.push_back(UseMI); in foldOperand()
489 if (UseMI->isCopy() && OpToFold.isReg() && in foldOperand()
490 TargetRegisterInfo::isVirtualRegister(UseMI->getOperand(0).getReg()) && in foldOperand()
491 TargetRegisterInfo::isVirtualRegister(UseMI->getOperand(1).getReg()) && in foldOperand()
492 TRI->isVGPR(*MRI, UseMI->getOperand(0).getReg()) && in foldOperand()
493 TRI->isVGPR(*MRI, UseMI->getOperand(1).getReg()) && in foldOperand()
494 !UseMI->getOperand(1).getSubReg()) { in foldOperand()
495 UseMI->getOperand(1).setReg(OpToFold.getReg()); in foldOperand()
496 UseMI->getOperand(1).setSubReg(OpToFold.getSubReg()); in foldOperand()
497 UseMI->getOperand(1).setIsKill(false); in foldOperand()
498 CopiesToReplace.push_back(UseMI); in foldOperand()
503 const MCInstrDesc &UseDesc = UseMI->getDesc(); in foldOperand()
514 tryAddToFoldList(FoldList, UseMI, UseOpIdx, &OpToFold, TII); in foldOperand()
548 tryAddToFoldList(FoldList, UseMI, UseOpIdx, &ImmOp, TII); in foldOperand()
554 tryAddToFoldList(FoldList, UseMI, UseOpIdx, &OpToFold, TII); in foldOperand()
811 MachineInstr *UseMI = Use->getParent(); in foldInstOperand() local
823 if (OpToFold.isImm() && tryConstantFoldOp(*MRI, TII, UseMI, &OpToFold)) { in foldInstOperand()
824 LLVM_DEBUG(dbgs() << "Constant folded " << *UseMI << '\n'); in foldInstOperand()
850 if (isInlineConstantIfFolded(TII, *UseMI, OpNo, OpToFold)) { in foldInstOperand()
851 foldOperand(OpToFold, UseMI, OpNo, FoldList, CopiesToReplace); in foldInstOperand()
861 MachineInstr *UseMI = NonInlineUse->getParent(); in foldInstOperand() local
862 foldOperand(OpToFold, UseMI, NonInlineUseOpNo, FoldList, CopiesToReplace); in foldInstOperand()
873 MachineInstr *UseMI = U->getParent(); in foldInstOperand() local
875 foldOperand(OpToFold, UseMI, U.getOperandNo(), in foldInstOperand()
897 << *Fold.UseMI << '\n'); in foldInstOperand()
898 tryFoldInst(TII, Fold.UseMI); in foldInstOperand()
901 TII->commuteInstruction(*Fold.UseMI, false); in foldInstOperand()