Home | History | Annotate | Download | only in ObjCARC

Lines Matching defs:Retain

83     bool optimizeRetainCall(Function &F, Instruction *Retain);
113 bool ObjCARCContract::optimizeRetainCall(Function &F, Instruction *Retain) {
114 ImmutableCallSite CS(GetArgRCIdentityRoot(Retain));
118 if (Call->getParent() != Retain->getParent())
121 // Check that the call is next to the retain.
125 if (&*I != Retain)
134 "return value.\nOld: "<< *Retain << "\n");
137 // retain/retainRV have the same properties.
139 cast<CallInst>(Retain)->setCalledFunction(Decl);
141 DEBUG(dbgs() << "New: " << *Retain << "\n");
145 /// Merge an autorelease with a retain into a fused call.
152 // Check that there are no instructions between the retain and the autorelease
154 CallInst *Retain = nullptr;
170 Retain = dyn_cast_or_null<CallInst>(*DependingInstructions.begin());
173 if (!Retain || GetBasicARCInstKind(Retain) != ARCInstKind::Retain ||
174 GetArgRCIdentityRoot(Retain) != Arg)
180 DEBUG(dbgs() << " Fusing retain/autorelease!\n"
182 " Retain: " << *Retain << "\n");
187 Retain->setCalledFunction(Decl);
189 DEBUG(dbgs() << " New RetainAutorelease: " << *Retain << "\n");
226 // If Inst is an unrelated retain, we don't care about it.
284 // Walk up from the Store to find the retain.
287 while (I != Begin && GetBasicARCInstKind(&*I) != ARCInstKind::Retain) {
290 // It is only safe to move the retain to the store if we can prove
292 // counts in between the retain and the store.
297 Instruction *Retain = &*I;
298 if (GetBasicARCInstKind(Retain) != ARCInstKind::Retain)
300 if (GetArgRCIdentityRoot(Retain) != New)
302 return Retain;
328 /// optimization it must be safe to move the retain, load, and release to
355 // Then walk up the BB and look for a retain on New without any intervening
357 Instruction *Retain =
361 if (!Retain)
368 llvm::dbgs() << " Contracting retain, release into objc_storeStrong.\n"
372 << " Retain: " << *Retain << "\n"
399 EraseInstruction(Retain);
419 case ARCInstKind::Retain: