Home | History | Annotate | Download | only in ObjCARC

Lines Matching defs:Retain

269 // The second retain and autorelease can be deleted.
295 // TODO: Delete release+retain pairs (rare).
301 "retain+autoreleaes eliminated");
302 STATISTIC(NumRRs, "Number of retain+release paths eliminated");
373 /// retain-decrement-use-release sequence or release-use-decrement-retain
379 /// there are retain-release pairs in code regions where the retain count
383 /// Also, a retain+release pair nested within another retain+release
750 void OptimizeRetainCall(Function &F, Instruction *Retain);
952 ObjCARCOpt::OptimizeRetainCall(Function &F, Instruction *Retain) {
953 ImmutableCallSite CS(GetObjCArg(Retain));
956 if (Call->getParent() != Retain->getParent()) return;
958 // Check that the call is next to the retain.
962 if (&*I != Retain)
973 << *Retain << "\n");
975 cast<CallInst>(Retain)->setCalledFunction(getRetainRVCallee(F.getParent()));
978 << *Retain << "\n");
1257 // Keep track of which of retain, release, autorelease, and retain_block
1304 // These can't be moved across things that care about the retain
1415 llvm_unreachable("bottom-up pointer in retain state!");
1463 llvm_unreachable("bottom-up pointer in retain state!");
1495 // Theoretically we could implement removal of nested retain+release
1535 // Don't do retain+release tracking for IC_RetainRV, because it's
1546 llvm_unreachable("bottom-up pointer in retain state!");
1586 llvm_unreachable("bottom-up pointer in retain state!");
1625 llvm_unreachable("bottom-up pointer in retain state!");
1704 // Don't do retain+release tracking for IC_RetainRV, because it's
1709 // hopefully eliminated the second retain, which may allow us to
1710 // eliminate the first retain too.
1711 // Theoretically we could implement removal of nested retain+release
1725 // A retain can be a potential use; procede to the generic checking
1948 // will be well behaved, i.e. they won't repeatedly call retain on a single
1986 // Insert the new retain and release calls.
2024 DEBUG(dbgs() << "ObjCARCOpt::MoveCalls: Inserting new Retain: " << *Call
2030 // Delete the original retain and release calls.
2037 DEBUG(dbgs() << "ObjCARCOpt::MoveCalls: Deleting retain: " << *OrigRetain <<
2198 // balance of retain and release calls through the program.
2205 // Determine whether the original call points are balanced in the retain and
2238 // Visit each retain.
2244 Instruction *Retain = cast<Instruction>(V);
2246 DEBUG(dbgs() << "ObjCARCOpt::PerformCodePlacement: Visiting: " << *Retain
2249 Value *Arg = GetObjCArg(Retain);
2267 NewRetains.push_back(Retain);
2281 // Clean up state for next retain.
2340 // If the load has a builtin retain, insert a plain retain for it.
2370 // If the load has a builtin retain, insert a plain retain for it.
2486 /// And delete the retain and autorelease.
2529 // count between the autorelease and the retain.
2536 CallInst *Retain =
2539 // Check that we found a retain with the same argument.
2540 if (!Retain ||
2541 !IsRetain(GetBasicInstructionClass(Retain)) ||
2542 GetObjCArg(Retain) != Arg)
2563 // count between the retain and the call.
2564 // Note that Retain need not be in BB.
2565 FindDependencies(CanChangeRetainCount, Arg, Retain->getParent(), Retain,
2583 // If so, we can zap the retain and autorelease.
2586 DEBUG(dbgs() << "ObjCARCOpt::OptimizeReturns: Erasing: " << *Retain
2589 EraseInstruction(Retain);
2667 // Optimizations for retain+release pairs.
2673 // no retain+release pair nesting is detected.