Lines Matching refs:Retain
133 // The second retain and autorelease can be deleted.
159 // TODO: Delete release+retain pairs (rare).
165 "retain+autoreleases eliminated");
166 STATISTIC(NumRRs, "Number of retain+release paths eliminated");
632 Constant *NewDecl = EP.get(ARCRuntimeEntryPointKind::Retain);
833 // Keep track of which of retain, release, autorelease, and retain_block
875 case ARCInstKind::Retain:
880 // These can't be moved across things that care about the retain
969 llvm_unreachable("bottom-up pointer in retain state!");
998 llvm_unreachable("bottom-up pointer in retain state!");
1122 case ARCInstKind::Retain:
1127 // Don't do retain+release tracking for ARCInstKind::RetainRV, because
1135 // A retain moving bottom up can be a use.
1155 // one direction, will match the inner retain on the original pointer with
1158 // both our retain and our release are KnownSafe.
1265 // a retain can be a potential use.
1267 case ARCInstKind::Retain:
1272 // A retain can be a potential use; proceed to the generic checking
1282 // If we succeed, copy S's RRInfo into the Release -> {Retain Set
1450 // will be well behaved, i.e. they won't repeatedly call retain on a single
1489 // Insert the new retain and release calls.
1493 Constant *Decl = EP.get(ARCRuntimeEntryPointKind::Retain);
1498 DEBUG(dbgs() << "Inserting new Retain: " << *Call << "\n"
1517 // Delete the original retain and release calls.
1521 DEBUG(dbgs() << "Deleting retain: " << *OrigRetain << "\n");
1572 // If the release does not have a reference to the retain as well,
1647 // If the retain does not have a reference to the release as well,
1702 // balance of retain and release calls through the program.
1717 // Determine whether the original call points are balanced in the retain and
1750 // Visit each retain.
1757 Instruction *Retain = cast<Instruction>(V);
1759 DEBUG(dbgs() << "Visiting: " << *Retain << "\n");
1761 Value *Arg = GetArgRCIdentityRoot(Retain);
1779 NewRetains.push_back(Retain);
1792 // Clean up state for next retain.
1853 // If the load has a builtin retain, insert a plain retain for it.
1855 Constant *Decl = EP.get(ARCRuntimeEntryPointKind::Retain);
1882 // If the load has a builtin retain, insert a plain retain for it.
1884 Constant *Decl = EP.get(ARCRuntimeEntryPointKind::Retain);
1993 /// between the Retain and the call that can affect the reference count of their
1994 /// shared pointer argument. Note that Retain need not be in BB.
1996 HasSafePathToPredecessorCall(const Value *Arg, Instruction *Retain,
2000 FindDependencies(CanChangeRetainCount, Arg, Retain->getParent(), Retain,
2019 /// Find a dependent retain that precedes the given autorelease for which there
2033 auto *Retain = dyn_cast_or_null<CallInst>(*DepInsts.begin());
2035 // Check that we found a retain with the same argument.
2036 if (!Retain || !IsRetain(GetBasicARCInstKind(Retain)) ||
2037 GetArgRCIdentityRoot(Retain) != Arg) {
2041 return Retain;
2077 /// And delete the retain and autorelease.
2107 CallInst *Retain = FindPredecessorRetainWithSafePath(
2112 if (!Retain)
2116 // between the retain and the call. Note that Retain need not be in BB.
2117 bool HasSafePathToCall = HasSafePathToPredecessorCall(Arg, Retain,
2126 // If so, we can zap the retain and autorelease.
2129 DEBUG(dbgs() << "Erasing: " << *Retain << "\nErasing: "
2131 EraseInstruction(Retain);
2149 case ARCInstKind::Retain:
2218 // Optimizations for retain+release pairs.
2219 if (UsedInThisFunction & ((1 << unsigned(ARCInstKind::Retain)) |
2224 // no retain+release pair nesting is detected.