Lines Matching refs:LoadInst
102 void breakBlockedCopies(MachineInstr *LoadInst, MachineInstr *StoreInst,
105 void buildCopies(int Size, MachineInstr *LoadInst, int64_t LdDispImm,
109 void buildCopy(MachineInstr *LoadInst, unsigned NLoadOpcode, int64_t LoadDisp,
339 findPotentialBlockers(MachineInstr *LoadInst) { in findPotentialBlockers() argument
343 for (auto PBInst = std::next(MachineBasicBlock::reverse_iterator(LoadInst)), in findPotentialBlockers()
344 E = LoadInst->getParent()->rend(); in findPotentialBlockers()
361 MachineBasicBlock *MBB = LoadInst->getParent(); in findPotentialBlockers()
385 void X86AvoidSFBPass::buildCopy(MachineInstr *LoadInst, unsigned NLoadOpcode, in buildCopy() argument
390 MachineOperand &LoadBase = getBaseOperand(LoadInst); in buildCopy()
392 MachineBasicBlock *MBB = LoadInst->getParent(); in buildCopy()
393 MachineMemOperand *LMMO = *LoadInst->memoperands_begin(); in buildCopy()
399 BuildMI(*MBB, LoadInst, LoadInst->getDebugLoc(), TII->get(NLoadOpcode), in buildCopy()
416 if (PrevInstrIt.getNodePtr() == LoadInst) in buildCopy()
417 StInst = LoadInst; in buildCopy()
436 void X86AvoidSFBPass::buildCopies(int Size, MachineInstr *LoadInst, in buildCopies() argument
443 if ((Size - MOV128SZ >= 0) && isYMMLoadOpcode(LoadInst->getOpcode())) { in buildCopies()
445 buildCopy(LoadInst, getYMMtoXMMLoadOpcode(LoadInst->getOpcode()), LdDisp, in buildCopies()
456 buildCopy(LoadInst, X86::MOV64rm, LdDisp, StoreInst, X86::MOV64mr, StDisp, in buildCopies()
466 buildCopy(LoadInst, X86::MOV32rm, LdDisp, StoreInst, X86::MOV32mr, StDisp, in buildCopies()
476 buildCopy(LoadInst, X86::MOV16rm, LdDisp, StoreInst, X86::MOV16mr, StDisp, in buildCopies()
486 buildCopy(LoadInst, X86::MOV8rm, LdDisp, StoreInst, X86::MOV8mr, StDisp, in buildCopies()
498 static void updateKillStatus(MachineInstr *LoadInst, MachineInstr *StoreInst) { in updateKillStatus() argument
499 MachineOperand &LoadBase = getBaseOperand(LoadInst); in updateKillStatus()
503 LoadInst->getParent()->instr_begin()) in updateKillStatus()
506 MachineInstr *LastLoad = LoadInst->getPrevNode(); in updateKillStatus()
511 if (StorePrevNonDbgInstr == LoadInst) in updateKillStatus()
512 LastLoad = LoadInst->getPrevNode()->getPrevNode(); in updateKillStatus()
517 if (StorePrevNonDbgInstr == LoadInst) in updateKillStatus()
518 StInst = LoadInst; in updateKillStatus()
562 unsigned X86AvoidSFBPass::getRegSizeInBytes(MachineInstr *LoadInst) { in getRegSizeInBytes() argument
563 const auto *TRC = TII->getRegClass(TII->get(LoadInst->getOpcode()), 0, TRI, in getRegSizeInBytes()
564 *LoadInst->getParent()->getParent()); in getRegSizeInBytes()
569 MachineInstr *LoadInst, MachineInstr *StoreInst, in breakBlockedCopies() argument
571 int64_t LdDispImm = getDispOperand(LoadInst).getImm(); in breakBlockedCopies()
599 buildCopies(Size1, LoadInst, LdDisp1, StoreInst, StDisp1, LMMOffset, in breakBlockedCopies()
602 buildCopies(Size2, LoadInst, LdDisp2, StoreInst, StDisp2, LMMOffset + Size1, in breakBlockedCopies()
609 unsigned Size3 = (LdDispImm + getRegSizeInBytes(LoadInst)) - LdDisp1; in breakBlockedCopies()
610 buildCopies(Size3, LoadInst, LdDisp1, StoreInst, StDisp1, LMMOffset, in breakBlockedCopies()
614 static bool hasSameBaseOpValue(MachineInstr *LoadInst, in hasSameBaseOpValue() argument
616 const MachineOperand &LoadBase = getBaseOperand(LoadInst); in hasSameBaseOpValue()
685 MachineInstr *LoadInst = LoadStoreInstPair.first; in runOnMachineFunction() local
686 int64_t LdDispImm = getDispOperand(LoadInst).getImm(); in runOnMachineFunction()
690 findPotentialBlockers(LoadInst); in runOnMachineFunction()
693 LoadInst->getOpcode()) || in runOnMachineFunction()
702 if (hasSameBaseOpValue(LoadInst, PBInst) && in runOnMachineFunction()
703 isBlockingStore(LdDispImm, getRegSizeInBytes(LoadInst), PBstDispImm, in runOnMachineFunction()
717 LLVM_DEBUG(LoadInst->dump()); in runOnMachineFunction()
721 breakBlockedCopies(LoadInst, StoreInst, BlockingStoresDispSizeMap); in runOnMachineFunction()
722 updateKillStatus(LoadInst, StoreInst); in runOnMachineFunction()
723 ForRemoval.push_back(LoadInst); in runOnMachineFunction()