Lines Matching refs:S0
115 PHINode *getPHIOperand(BasicBlock *BB, StoreInst *S0, StoreInst *S1);
118 bool canSinkStoresAndGEPs(StoreInst *S0, StoreInst *S1) const;
206 PHINode *MergedLoadStoreMotion::getPHIOperand(BasicBlock *BB, StoreInst *S0, in getPHIOperand() argument
209 Value *Opd1 = S0->getValueOperand(); in getPHIOperand()
216 NewPN->applyMergedLocation(S0->getDebugLoc(), S1->getDebugLoc()); in getPHIOperand()
217 NewPN->addIncoming(Opd1, S0->getParent()); in getPHIOperand()
225 bool MergedLoadStoreMotion::canSinkStoresAndGEPs(StoreInst *S0, in canSinkStoresAndGEPs() argument
227 auto *A0 = dyn_cast<Instruction>(S0->getPointerOperand()); in canSinkStoresAndGEPs()
230 (A0->getParent() == S0->getParent()) && A1->hasOneUse() && in canSinkStoresAndGEPs()
239 void MergedLoadStoreMotion::sinkStoresAndGEPs(BasicBlock *BB, StoreInst *S0, in sinkStoresAndGEPs() argument
242 auto *A0 = dyn_cast<Instruction>(S0->getPointerOperand()); in sinkStoresAndGEPs()
245 dbgs() << "Instruction Left\n"; S0->dump(); dbgs() << "\n"; in sinkStoresAndGEPs()
250 S0->andIRFlags(S1); in sinkStoresAndGEPs()
251 S0->dropUnknownNonDebugMetadata(); in sinkStoresAndGEPs()
254 StoreInst *SNew = cast<StoreInst>(S0->clone()); in sinkStoresAndGEPs()
259 assert(S0->getParent() == A0->getParent()); in sinkStoresAndGEPs()
263 if (PHINode *NewPN = getPHIOperand(BB, S0, S1)) in sinkStoresAndGEPs()
265 S0->eraseFromParent(); in sinkStoresAndGEPs()
310 auto *S0 = dyn_cast<StoreInst>(I); in mergeStores() local
311 if (!S0 || !S0->isSimple()) in mergeStores()
317 if (StoreInst *S1 = canSinkFromBlock(Pred1, S0)) { in mergeStores()
318 if (!canSinkStoresAndGEPs(S0, S1)) in mergeStores()
334 sinkStoresAndGEPs(SinkBB, S0, S1); in mergeStores()