• Home
  • Raw
  • Download

Lines Matching refs:UseMI

31   MachineInstr *UseMI;  member
45 UseMI(MI), OpToFold(nullptr), ShrinkOpcode(ShrinkOp), UseOpNo(OpNo), in FoldCandidate()
95 MachineInstr *UseMI,
135 const MachineInstr &UseMI, in isInlineConstantIfFolded() argument
138 if (TII->isInlineConstant(UseMI, OpNo, OpToFold)) in isInlineConstantIfFolded()
141 unsigned Opc = UseMI.getOpcode(); in isInlineConstantIfFolded()
172 const MachineInstr &UseMI, in frameIndexMayFold() argument
176 TII->isMUBUF(UseMI) && in frameIndexMayFold()
177 OpNo == AMDGPU::getNamedOperandIdx(UseMI.getOpcode(), AMDGPU::OpName::vaddr); in frameIndexMayFold()
188 MachineInstr *MI = Fold.UseMI; in updateOperand()
309 if (Candidate.UseMI == MI) in isUseMIInFoldList()
321 if (Fold.UseMI == MI && Fold.UseOpNo == OpNo) in appendFoldCandidate()
523 MachineInstr *UseMI, in tryToFoldACImm() argument
526 const MCInstrDesc &Desc = UseMI->getDesc(); in tryToFoldACImm()
537 TII->isOperandLegal(*UseMI, UseOpIdx, &OpToFold)) { in tryToFoldACImm()
538 UseMI->getOperand(UseOpIdx).ChangeToImmediate(OpToFold.getImm()); in tryToFoldACImm()
549 if (llvm::find_if(FoldList, [UseMI](const FoldCandidate &FC) { in tryToFoldACImm()
550 return FC.UseMI == UseMI; }) != FoldList.end()) in tryToFoldACImm()
553 MachineRegisterInfo &MRI = UseMI->getParent()->getParent()->getRegInfo(); in tryToFoldACImm()
568 !TII->isOperandLegal(*UseMI, UseOpIdx, Op)) in tryToFoldACImm()
577 appendFoldCandidate(FoldList, UseMI, UseOpIdx, Defs[0].first); in tryToFoldACImm()
583 MachineInstr *UseMI, in foldOperand() argument
587 const MachineOperand &UseOp = UseMI->getOperand(UseOpIdx); in foldOperand()
589 if (!isUseSafeToFold(TII, *UseMI, UseOp)) in foldOperand()
601 if (UseMI->isRegSequence()) { in foldOperand()
602 Register RegSeqDstReg = UseMI->getOperand(0).getReg(); in foldOperand()
603 unsigned RegSeqDstSubReg = UseMI->getOperand(UseOpIdx + 1).getImm(); in foldOperand()
613 if (tryToFoldACImm(TII, UseMI->getOperand(0), RSUseMI, in foldOperand()
627 if (tryToFoldACImm(TII, OpToFold, UseMI, UseOpIdx, FoldList)) in foldOperand()
630 if (frameIndexMayFold(TII, *UseMI, UseOpIdx, OpToFold)) { in foldOperand()
634 if (TII->getNamedOperand(*UseMI, AMDGPU::OpName::srsrc)->getReg() != in foldOperand()
640 *TII->getNamedOperand(*UseMI, AMDGPU::OpName::soffset); in foldOperand()
647 UseMI->getOperand(UseOpIdx).ChangeToFrameIndex(OpToFold.getIndex()); in foldOperand()
659 if (FoldingImmLike && UseMI->isCopy()) { in foldOperand()
660 Register DestReg = UseMI->getOperand(0).getReg(); in foldOperand()
661 Register SrcReg = UseMI->getOperand(1).getReg(); in foldOperand()
686 &UseMI->getOperand(1)); in foldOperand()
690 foldOperand(*F.OpToFold, F.UseMI, F.UseOpNo, FoldList, CopiesToReplace); in foldOperand()
696 UseMI->setDesc(TII->get(AMDGPU::V_ACCVGPR_WRITE_B32)); in foldOperand()
697 UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm()); in foldOperand()
698 CopiesToReplace.push_back(UseMI); in foldOperand()
710 UseMI->setDesc(TII->get(MovOp)); in foldOperand()
711 MachineInstr::mop_iterator ImpOpI = UseMI->implicit_operands().begin(); in foldOperand()
712 MachineInstr::mop_iterator ImpOpE = UseMI->implicit_operands().end(); in foldOperand()
716 UseMI->RemoveOperand(UseMI->getOperandNo(Tmp)); in foldOperand()
718 CopiesToReplace.push_back(UseMI); in foldOperand()
720 if (UseMI->isCopy() && OpToFold.isReg() && in foldOperand()
721 UseMI->getOperand(0).getReg().isVirtual() && in foldOperand()
722 !UseMI->getOperand(1).getSubReg()) { in foldOperand()
724 << "\n into " << *UseMI << '\n'); in foldOperand()
725 unsigned Size = TII->getOpSize(*UseMI, 1); in foldOperand()
727 UseMI->getOperand(1).setReg(UseReg); in foldOperand()
728 UseMI->getOperand(1).setSubReg(OpToFold.getSubReg()); in foldOperand()
729 UseMI->getOperand(1).setIsKill(false); in foldOperand()
730 CopiesToReplace.push_back(UseMI); in foldOperand()
738 if (Size > 4 && TRI->isAGPR(*MRI, UseMI->getOperand(0).getReg()) && in foldOperand()
741 const DebugLoc &DL = UseMI->getDebugLoc(); in foldOperand()
742 MachineBasicBlock &MBB = *UseMI->getParent(); in foldOperand()
744 UseMI->setDesc(TII->get(AMDGPU::REG_SEQUENCE)); in foldOperand()
745 for (unsigned I = UseMI->getNumOperands() - 1; I > 0; --I) in foldOperand()
746 UseMI->RemoveOperand(I); in foldOperand()
748 MachineInstrBuilder B(*MBB.getParent(), UseMI); in foldOperand()
759 BuildMI(MBB, UseMI, DL, in foldOperand()
786 BuildMI(MBB, UseMI, DL, TII->get(AMDGPU::COPY), Tmp).add(*Def); in foldOperand()
797 BuildMI(MBB, UseMI, DL, TII->get(AMDGPU::COPY), Vgpr).add(*Def); in foldOperand()
801 BuildMI(MBB, UseMI, DL, in foldOperand()
808 LLVM_DEBUG(dbgs() << "Folded " << *UseMI << '\n'); in foldOperand()
814 if (TRI->isAGPR(*MRI, UseMI->getOperand(0).getReg()) && in foldOperand()
815 TRI->isVGPR(*MRI, UseMI->getOperand(1).getReg())) in foldOperand()
816 UseMI->setDesc(TII->get(AMDGPU::V_ACCVGPR_WRITE_B32)); in foldOperand()
817 else if (TRI->isVGPR(*MRI, UseMI->getOperand(0).getReg()) && in foldOperand()
818 TRI->isAGPR(*MRI, UseMI->getOperand(1).getReg())) in foldOperand()
819 UseMI->setDesc(TII->get(AMDGPU::V_ACCVGPR_READ_B32)); in foldOperand()
823 unsigned UseOpc = UseMI->getOpcode(); in foldOperand()
834 UseMI->getOperand(UseOpIdx).getReg(), in foldOperand()
836 *UseMI)) in foldOperand()
839 UseMI->setDesc(TII->get(AMDGPU::S_MOV_B32)); in foldOperand()
842 UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm()); in foldOperand()
844 UseMI->getOperand(1).ChangeToFrameIndex(OpToFold.getIndex()); in foldOperand()
845 UseMI->RemoveOperand(2); // Remove exec read (or src1 for readlane) in foldOperand()
851 UseMI->getOperand(UseOpIdx).getReg(), in foldOperand()
853 *UseMI)) in foldOperand()
860 UseMI->setDesc(TII->get(AMDGPU::COPY)); in foldOperand()
861 UseMI->getOperand(1).setReg(OpToFold.getReg()); in foldOperand()
862 UseMI->getOperand(1).setSubReg(OpToFold.getSubReg()); in foldOperand()
863 UseMI->getOperand(1).setIsKill(false); in foldOperand()
864 UseMI->RemoveOperand(2); // Remove exec read (or src1 for readlane) in foldOperand()
869 const MCInstrDesc &UseDesc = UseMI->getDesc(); in foldOperand()
880 tryAddToFoldList(FoldList, UseMI, UseOpIdx, &OpToFold, TII); in foldOperand()
910 tryAddToFoldList(FoldList, UseMI, UseOpIdx, &ImmOp, TII); in foldOperand()
916 tryAddToFoldList(FoldList, UseMI, UseOpIdx, &OpToFold, TII); in foldOperand()
1183 MachineInstr *UseMI = Use->getParent(); in foldInstOperand() local
1195 if (OpToFold.isImm() && tryConstantFoldOp(*MRI, TII, UseMI, &OpToFold)) { in foldInstOperand()
1196 LLVM_DEBUG(dbgs() << "Constant folded " << *UseMI << '\n'); in foldInstOperand()
1222 if (isInlineConstantIfFolded(TII, *UseMI, OpNo, OpToFold)) { in foldInstOperand()
1223 foldOperand(OpToFold, UseMI, OpNo, FoldList, CopiesToReplace); in foldInstOperand()
1224 } else if (frameIndexMayFold(TII, *UseMI, OpNo, OpToFold)) { in foldInstOperand()
1225 foldOperand(OpToFold, UseMI, OpNo, FoldList, in foldInstOperand()
1236 MachineInstr *UseMI = NonInlineUse->getParent(); in foldInstOperand() local
1237 foldOperand(OpToFold, UseMI, NonInlineUseOpNo, FoldList, CopiesToReplace); in foldInstOperand()
1248 MachineInstr *UseMI = U->getParent(); in foldInstOperand() local
1250 foldOperand(OpToFold, UseMI, U.getOperandNo(), in foldInstOperand()
1266 execMayBeModifiedBeforeUse(*MRI, Reg, *DefMI, *Fold.UseMI)) in foldInstOperand()
1280 << *Fold.UseMI << '\n'); in foldInstOperand()
1281 tryFoldInst(TII, Fold.UseMI); in foldInstOperand()
1284 TII->commuteInstruction(*Fold.UseMI, false); in foldInstOperand()