• Home
  • Raw
  • Download

Lines Matching full:retain

83     bool optimizeRetainCall(Function &F, Instruction *Retain);
113 bool ObjCARCContract::optimizeRetainCall(Function &F, Instruction *Retain) { in optimizeRetainCall() argument
114 ImmutableCallSite CS(GetArgRCIdentityRoot(Retain)); in optimizeRetainCall()
118 if (Call->getParent() != Retain->getParent()) in optimizeRetainCall()
121 // Check that the call is next to the retain. in optimizeRetainCall()
125 if (&*I != Retain) in optimizeRetainCall()
134 "return value.\nOld: "<< *Retain << "\n"); in optimizeRetainCall()
137 // retain/retainRV have the same properties. in optimizeRetainCall()
139 cast<CallInst>(Retain)->setCalledFunction(Decl); in optimizeRetainCall()
141 DEBUG(dbgs() << "New: " << *Retain << "\n"); in optimizeRetainCall()
145 /// Merge an autorelease with a retain into a fused call.
152 // Check that there are no instructions between the retain and the autorelease in contractAutorelease()
154 CallInst *Retain = nullptr; in contractAutorelease() local
170 Retain = dyn_cast_or_null<CallInst>(*DependingInstructions.begin()); in contractAutorelease()
173 if (!Retain || GetBasicARCInstKind(Retain) != ARCInstKind::Retain || in contractAutorelease()
174 GetArgRCIdentityRoot(Retain) != Arg) in contractAutorelease()
180 DEBUG(dbgs() << " Fusing retain/autorelease!\n" in contractAutorelease()
182 " Retain: " << *Retain << "\n"); in contractAutorelease()
187 Retain->setCalledFunction(Decl); in contractAutorelease()
189 DEBUG(dbgs() << " New RetainAutorelease: " << *Retain << "\n"); in contractAutorelease()
227 // If Inst is an unrelated retain, we don't care about it. in findSafeStoreForStoreStrongContraction()
285 // Walk up from the Store to find the retain. in findRetainForStoreStrongContraction()
288 while (I != Begin && GetBasicARCInstKind(&*I) != ARCInstKind::Retain) { in findRetainForStoreStrongContraction()
291 // It is only safe to move the retain to the store if we can prove in findRetainForStoreStrongContraction()
293 // counts in between the retain and the store. in findRetainForStoreStrongContraction()
298 Instruction *Retain = &*I; in findRetainForStoreStrongContraction() local
299 if (GetBasicARCInstKind(Retain) != ARCInstKind::Retain) in findRetainForStoreStrongContraction()
301 if (GetArgRCIdentityRoot(Retain) != New) in findRetainForStoreStrongContraction()
303 return Retain; in findRetainForStoreStrongContraction()
329 /// optimization it must be safe to move the retain, load, and release to
356 // Then walk up the BB and look for a retain on New without any intervening in tryToContractReleaseIntoStoreStrong()
358 Instruction *Retain = in tryToContractReleaseIntoStoreStrong() local
362 if (!Retain) in tryToContractReleaseIntoStoreStrong()
369 llvm::dbgs() << " Contracting retain, release into objc_storeStrong.\n" in tryToContractReleaseIntoStoreStrong()
373 << " Retain: " << *Retain << "\n" in tryToContractReleaseIntoStoreStrong()
400 EraseInstruction(Retain); in tryToContractReleaseIntoStoreStrong()
420 case ARCInstKind::Retain: in tryToPeepholeInstruction()