Lines Matching refs:SI
121 for (Instruction *SI : TheStores) in isProfitableToUseMemset()
122 if (!isa<StoreInst>(SI)) in isProfitableToUseMemset()
175 if (auto *SI = dyn_cast<StoreInst>(Inst)) in addInst() local
176 addStore(OffsetFromFirst, SI); in addInst()
181 void addStore(int64_t OffsetFromFirst, StoreInst *SI) { in addStore() argument
182 TypeSize StoreSize = DL.getTypeStoreSize(SI->getOperand(0)->getType()); in addStore()
185 SI->getPointerOperand(), SI->getAlign(), SI); in addStore()
364 if (auto *SI = dyn_cast<StoreInst>(StartInst)) in tryMergingIntoMemset() local
365 if (DL.getTypeStoreSize(SI->getOperand(0)->getType()).isScalable()) in tryMergingIntoMemset()
483 LLVM_DEBUG(dbgs() << "Replace stores:\n"; for (Instruction *SI in tryMergingIntoMemset()
485 << *SI << '\n'; in tryMergingIntoMemset()
498 for (Instruction *SI : Range.TheStores) in tryMergingIntoMemset()
499 eraseInstruction(SI); in tryMergingIntoMemset()
511 bool MemCpyOptPass::moveUp(StoreInst *SI, Instruction *P, const LoadInst *LI) { in moveUp() argument
513 MemoryLocation StoreLoc = MemoryLocation::get(SI); in moveUp()
522 if (I && I->getParent() == SI->getParent()) { in moveUp()
530 if (!AddArg(SI->getPointerOperand())) in moveUp()
534 SmallVector<Instruction *, 8> ToLift{SI}; in moveUp()
544 for (auto I = --SI->getIterator(), E = P->getIterator(); I != E; --I) { in moveUp()
635 bool MemCpyOptPass::processStoreOfLoad(StoreInst *SI, LoadInst *LI, in processStoreOfLoad() argument
638 if (!LI->isSimple() || !LI->hasOneUse() || LI->getParent() != SI->getParent()) in processStoreOfLoad()
656 Instruction *P = SI; in processStoreOfLoad()
657 for (auto &I : make_range(++LI->getIterator(), SI->getIterator())) { in processStoreOfLoad()
668 if (P && P != SI) { in processStoreOfLoad()
669 if (!moveUp(SI, P, LI)) in processStoreOfLoad()
681 if (isModSet(AA->getModRefInfo(SI, LoadLoc))) in processStoreOfLoad()
689 M = Builder.CreateMemMove(SI->getPointerOperand(), SI->getAlign(), in processStoreOfLoad()
693 M = Builder.CreateMemCpy(SI->getPointerOperand(), SI->getAlign(), in processStoreOfLoad()
695 M->copyMetadata(*SI, LLVMContext::MD_DIAssignID); in processStoreOfLoad()
697 LLVM_DEBUG(dbgs() << "Promoting " << *LI << " to " << *SI << " => " << *M in processStoreOfLoad()
701 cast<MemoryDef>(MSSAU->getMemorySSA()->getMemoryAccess(SI)); in processStoreOfLoad()
705 eraseInstruction(SI); in processStoreOfLoad()
729 LI, SI, SI->getPointerOperand()->stripPointerCasts(), in processStoreOfLoad()
731 DL.getTypeStoreSize(SI->getOperand(0)->getType()), in processStoreOfLoad()
732 std::min(SI->getAlign(), LI->getAlign()), BAA, GetCall); in processStoreOfLoad()
734 eraseInstruction(SI); in processStoreOfLoad()
743 if (auto *DestAlloca = dyn_cast<AllocaInst>(SI->getPointerOperand())) { in processStoreOfLoad()
745 if (performStackMoveOptzn(LI, SI, DestAlloca, SrcAlloca, in processStoreOfLoad()
748 BBI = SI->getNextNonDebugInstruction()->getIterator(); in processStoreOfLoad()
749 eraseInstruction(SI); in processStoreOfLoad()
760 bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) { in processStore() argument
761 if (!SI->isSimple()) in processStore()
770 if (SI->getMetadata(LLVMContext::MD_nontemporal)) in processStore()
773 const DataLayout &DL = SI->getDataLayout(); in processStore()
775 Value *StoredVal = SI->getValueOperand(); in processStore()
784 return processStoreOfLoad(SI, LI, DL, BBI); in processStore()
799 auto *V = SI->getOperand(0); in processStore()
802 tryMergingIntoMemset(SI, SI->getPointerOperand(), ByteVal)) { in processStore()
813 IRBuilder<> Builder(SI); in processStore()
814 auto *M = Builder.CreateMemSet(SI->getPointerOperand(), ByteVal, Size, in processStore()
815 SI->getAlign()); in processStore()
816 M->copyMetadata(*SI, LLVMContext::MD_DIAssignID); in processStore()
818 LLVM_DEBUG(dbgs() << "Promoting " << *SI << " to " << *M << "\n"); in processStore()
822 auto *StoreDef = cast<MemoryDef>(MSSA->getMemoryAccess(SI)); in processStore()
826 eraseInstruction(SI); in processStore()
2064 if (auto *SI = dyn_cast<StoreInst>(I)) in iterateOnFunction() local
2065 MadeChange |= processStore(SI, BI); in iterateOnFunction()