Lines Matching refs:SI
118 for (Instruction *SI : TheStores) in isProfitableToUseMemset()
119 if (!isa<StoreInst>(SI)) in isProfitableToUseMemset()
171 if (auto *SI = dyn_cast<StoreInst>(Inst)) in addInst() local
172 addStore(OffsetFromFirst, SI); in addInst()
177 void addStore(int64_t OffsetFromFirst, StoreInst *SI) { in addStore() argument
178 TypeSize StoreSize = DL.getTypeStoreSize(SI->getOperand(0)->getType()); in addStore()
181 SI->getPointerOperand(), SI->getAlign(), SI); in addStore()
360 if (auto *SI = dyn_cast<StoreInst>(StartInst)) in tryMergingIntoMemset() local
361 if (DL.getTypeStoreSize(SI->getOperand(0)->getType()).isScalable()) in tryMergingIntoMemset()
477 LLVM_DEBUG(dbgs() << "Replace stores:\n"; for (Instruction *SI in tryMergingIntoMemset()
479 << *SI << '\n'; in tryMergingIntoMemset()
494 for (Instruction *SI : Range.TheStores) in tryMergingIntoMemset()
495 eraseInstruction(SI); in tryMergingIntoMemset()
507 bool MemCpyOptPass::moveUp(StoreInst *SI, Instruction *P, const LoadInst *LI) { in moveUp() argument
509 MemoryLocation StoreLoc = MemoryLocation::get(SI); in moveUp()
518 if (I && I->getParent() == SI->getParent()) { in moveUp()
525 if (!AddArg(SI->getPointerOperand())) in moveUp()
529 SmallVector<Instruction *, 8> ToLift{SI}; in moveUp()
539 for (auto I = --SI->getIterator(), E = P->getIterator(); I != E; --I) { in moveUp()
630 bool MemCpyOptPass::processStoreOfLoad(StoreInst *SI, LoadInst *LI, in processStoreOfLoad() argument
634 LI->getParent() != SI->getParent()) in processStoreOfLoad()
652 Instruction *P = SI; in processStoreOfLoad()
653 for (auto &I : make_range(++LI->getIterator(), SI->getIterator())) { in processStoreOfLoad()
664 if (P && P != SI) { in processStoreOfLoad()
665 if (!moveUp(SI, P, LI)) in processStoreOfLoad()
677 if (isModSet(AA->getModRefInfo(SI, LoadLoc))) in processStoreOfLoad()
686 SI->getPointerOperand(), SI->getAlign(), in processStoreOfLoad()
690 SI->getPointerOperand(), SI->getAlign(), in processStoreOfLoad()
692 M->copyMetadata(*SI, LLVMContext::MD_DIAssignID); in processStoreOfLoad()
694 LLVM_DEBUG(dbgs() << "Promoting " << *LI << " to " << *SI << " => " in processStoreOfLoad()
698 cast<MemoryDef>(MSSAU->getMemorySSA()->getMemoryAccess(SI)); in processStoreOfLoad()
702 eraseInstruction(SI); in processStoreOfLoad()
726 LI, SI, SI->getPointerOperand()->stripPointerCasts(), in processStoreOfLoad()
728 DL.getTypeStoreSize(SI->getOperand(0)->getType()), in processStoreOfLoad()
729 std::min(SI->getAlign(), LI->getAlign()), BAA, GetCall); in processStoreOfLoad()
731 eraseInstruction(SI); in processStoreOfLoad()
740 if (auto *DestAlloca = dyn_cast<AllocaInst>(SI->getPointerOperand())) { in processStoreOfLoad()
742 if (performStackMoveOptzn(LI, SI, DestAlloca, SrcAlloca, in processStoreOfLoad()
745 BBI = SI->getNextNonDebugInstruction()->getIterator(); in processStoreOfLoad()
746 eraseInstruction(SI); in processStoreOfLoad()
757 bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) { in processStore() argument
758 if (!SI->isSimple()) return false; in processStore()
766 if (SI->getMetadata(LLVMContext::MD_nontemporal)) in processStore()
769 const DataLayout &DL = SI->getModule()->getDataLayout(); in processStore()
771 Value *StoredVal = SI->getValueOperand(); in processStore()
780 return processStoreOfLoad(SI, LI, DL, BBI); in processStore()
795 auto *V = SI->getOperand(0); in processStore()
797 if (Instruction *I = tryMergingIntoMemset(SI, SI->getPointerOperand(), in processStore()
809 IRBuilder<> Builder(SI); in processStore()
810 auto *M = Builder.CreateMemSet(SI->getPointerOperand(), ByteVal, Size, in processStore()
811 SI->getAlign()); in processStore()
812 M->copyMetadata(*SI, LLVMContext::MD_DIAssignID); in processStore()
814 LLVM_DEBUG(dbgs() << "Promoting " << *SI << " to " << *M << "\n"); in processStore()
818 auto *StoreDef = cast<MemoryDef>(MSSA->getMemoryAccess(SI)); in processStore()
823 eraseInstruction(SI); in processStore()
1995 if (auto *SI = dyn_cast<StoreInst>(I)) in iterateOnFunction() local
1996 MadeChange |= processStore(SI, BI); in iterateOnFunction()