Lines Matching defs:Retain
313 // The second retain and autorelease can be deleted.
339 // TODO: Delete release+retain pairs (rare).
345 "retain+autoreleases eliminated");
346 STATISTIC(NumRRs, "Number of retain+release paths eliminated");
427 /// retain-decrement-use-release sequence or release-use-decrement-retain
433 /// there are retain-release pairs in code regions where the retain count
437 /// Also, a retain+release pair nested within another retain+release
460 /// retain/release pairs.
1395 DEBUG(dbgs() << "Strength reduced retainBlock => retain.\n");
1567 // Keep track of which of retain, release, autorelease, and retain_block
1614 // These can't be moved across things that care about the retain
1703 llvm_unreachable("bottom-up pointer in retain state!");
1732 llvm_unreachable("bottom-up pointer in retain state!");
1855 // Theoretically we could implement removal of nested retain+release
1898 // Don't do retain+release tracking for IC_RetainRV, because it's
1907 llvm_unreachable("bottom-up pointer in retain state!");
1910 // A retain moving bottom up can be a use.
1930 // one direction, will match the inner retain on the original pointer with
1933 // both our retain and our release are KnownSafe.
1974 llvm_unreachable("bottom-up pointer in retain state!");
2022 llvm_unreachable("bottom-up pointer in retain state!");
2111 // Don't do retain+release tracking for IC_RetainRV, because it's
2116 // hopefully eliminated the second retain, which may allow us to
2117 // eliminate the first retain too.
2118 // Theoretically we could implement removal of nested retain+release
2132 // A retain can be a potential use; procede to the generic checking
2380 // will be well behaved, i.e. they won't repeatedly call retain on a single
2420 // Insert the new retain and release calls.
2432 DEBUG(dbgs() << "Inserting new Retain: " << *Call << "\n"
2454 // Delete the original retain and release calls.
2461 DEBUG(dbgs() << "Deleting retain: " << *OrigRetain << "\n");
2630 // MultipleOwners, we can safely remove the retain/releases. Otherwise we need
2640 // balance of retain and release calls through the program.
2655 // Determine whether the original call points are balanced in the retain and
2696 // Visit each retain.
2702 Instruction *Retain = cast<Instruction>(V);
2704 DEBUG(dbgs() << "Visiting: " << *Retain << "\n");
2706 Value *Arg = GetObjCArg(Retain);
2724 NewRetains.push_back(Retain);
2738 // Clean up state for next retain.
2798 // If the load has a builtin retain, insert a plain retain for it.
2827 // If the load has a builtin retain, insert a plain retain for it.
2940 /// between the Retain and the call that can affect the reference count of their
2941 /// shared pointer argument. Note that Retain need not be in BB.
2943 HasSafePathToPredecessorCall(const Value *Arg, Instruction *Retain,
2947 FindDependencies(CanChangeRetainCount, Arg, Retain->getParent(), Retain,
2967 /// Find a dependent retain that precedes the given autorelease for which there
2981 CallInst *Retain =
2984 // Check that we found a retain with the same argument.
2985 if (!Retain ||
2986 !IsRetain(GetBasicInstructionClass(Retain)) ||
2987 GetObjCArg(Retain) != Arg) {
2991 return Retain;
3028 /// And delete the retain and autorelease.
3061 CallInst *Retain =
3067 if (!Retain)
3071 // between the retain and the call. Note that Retain need not be in BB.
3072 bool HasSafePathToCall = HasSafePathToPredecessorCall(Arg, Retain,
3081 // If so, we can zap the retain and autorelease.
3084 DEBUG(dbgs() << "Erasing: " << *Retain << "\nErasing: "
3086 EraseInstruction(Retain);
3188 // Optimizations for retain+release pairs.
3194 // no retain+release pair nesting is detected.