Lines Matching defs:Arg
86 static const Value *FindSingleUseIdentifiedObject(const Value *Arg) {
89 if (isa<ConstantData>(Arg))
92 if (Arg->hasOneUse()) {
93 if (const BitCastInst *BC = dyn_cast<BitCastInst>(Arg))
95 if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Arg))
98 if (IsForwarding(GetBasicARCInstKind(Arg)))
100 cast<CallInst>(Arg)->getArgOperand(0));
101 if (!IsObjCIdentifiedObject(Arg))
103 return Arg;
108 if (IsObjCIdentifiedObject(Arg)) {
109 for (const User *U : Arg->users())
110 if (!U->use_empty() || GetRCIdentityRoot(U) != Arg)
113 return Arg;
262 /// pointer Arg. Return a new initialized PtrState describing the top down
263 /// state for Arg if we do not find one.
264 TopDownPtrState &getPtrTopDownState(const Value *Arg) {
265 return PerPtrTopDown[Arg];
269 /// pointer Arg. Return a new initialized PtrState describing the bottom up
270 /// state for Arg if we do not find one.
271 BottomUpPtrState &getPtrBottomUpState(const Value *Arg) {
272 return PerPtrBottomUp[Arg];
276 /// pointer Arg.
277 bottom_up_ptr_iterator findPtrBottomUpState(const Value *Arg) {
278 return PerPtrBottomUp.find(Arg);
514 ARCInstKind Class, const Value *Arg);
520 const Value *&Arg, ARCInstKind Class,
546 void MoveCalls(Value *Arg, RRInfo &RetainsToMove, RRInfo &ReleasesToMove,
557 Value *Arg, bool KnownSafe,
610 const Value *Arg = GetArgRCIdentityRoot(RetainRV);
611 if (const Instruction *Call = dyn_cast<CallBase>(Arg)) {
652 Function &F, Instruction *Inst, const Value *&Arg, ARCInstKind Class,
661 Arg = GetArgRCIdentityRoot(Inst);
663 if (Arg != AutoreleaseRVArg) {
665 const PHINode *PN = dyn_cast<PHINode>(Arg);
706 OptimizeIndividualCallImpl(F, Release, ARCInstKind::Release, Arg);
819 const Value *Arg = nullptr;
841 if (OptimizeInlinedAutoreleaseRVCall(F, Inst, Arg, Class,
852 OptimizeIndividualCallImpl(F, Inst, Class, Arg);
888 const Value *Arg) {
984 const Value *Arg = Call->getArgOperand(0);
985 Arg = FindSingleUseIdentifiedObject(Arg);
986 if (Arg) {
1044 if (!Arg)
1045 Arg = GetArgRCIdentityRoot(Inst);
1048 if (IsNullOrUndef(Arg)) {
1061 // If Arg is a PHI, and one or more incoming values to the
1072 Worklist.push_back(std::make_pair(Inst, Arg));
1076 Arg = Pair.second;
1078 const PHINode *PN = dyn_cast<PHINode>(Arg);
1114 DepInst = findSingleDependency(NeedsPositiveRetainCount, Arg,
1119 DepInst = findSingleDependency(AutoreleasePoolBoundary, Arg,
1258 const Value *Arg = I->first;
1269 const BottomUpPtrState &SuccS = BBI->second.getPtrBottomUpState(Arg);
1331 const Value *Arg = nullptr;
1337 Arg = GetArgRCIdentityRoot(Inst);
1339 BottomUpPtrState &S = MyStates.getPtrBottomUpState(Arg);
1350 Arg = GetArgRCIdentityRoot(Inst);
1351 BottomUpPtrState &S = MyStates.getPtrBottomUpState(Arg);
1382 if (Ptr == Arg)
1498 const Value *Arg = nullptr;
1527 Arg = GetArgRCIdentityRoot(Inst);
1528 TopDownPtrState &S = MyStates.getPtrTopDownState(Arg);
1535 Arg = GetArgRCIdentityRoot(Inst);
1536 TopDownPtrState &S = MyStates.getPtrTopDownState(Arg);
1566 if (Ptr == Arg)
1760 void ObjCARCOpt::MoveCalls(Value *Arg, RRInfo &RetainsToMove,
1766 Type *ArgTy = Arg->getType();
1773 Value *MyArg = ArgTy == ParamTy ? Arg
1774 : new BitCastInst(Arg, ParamTy, "",
1790 Value *MyArg = ArgTy == ParamTy ? Arg
1791 : new BitCastInst(Arg, ParamTy, "",
1830 RRInfo &ReleasesToMove, Value *Arg, bool KnownSafe,
2043 Value *Arg = GetArgRCIdentityRoot(Retain);
2048 bool KnownSafe = isa<Constant>(Arg) || isa<AllocaInst>(Arg);
2052 if (const LoadInst *LI = dyn_cast<LoadInst>(Arg))
2065 RetainsToMove, ReleasesToMove, Arg, KnownSafe,
2071 MoveCalls(Arg, RetainsToMove, ReleasesToMove,
2126 Value *Arg = Call->getArgOperand(0);
2128 switch (PA.getAA()->alias(Arg, EarlierArg)) {
2156 Value *Arg = Call->getArgOperand(0);
2158 switch (PA.getAA()->alias(Arg, EarlierArg)) {
2207 Value *Arg = Call->getArgOperand(0);
2208 if (AllocaInst *Alloca = dyn_cast<AllocaInst>(Arg)) {
2274 static CallInst *HasSafePathToPredecessorCall(const Value *Arg,
2278 CanChangeRetainCount, Arg, Retain->getParent(), Retain, PA));
2281 if (!Call || Arg != Call)
2293 /// Arg.
2295 FindPredecessorRetainWithSafePath(const Value *Arg, BasicBlock *BB,
2299 findSingleDependency(CanChangeRetainCount, Arg, BB, Autorelease, PA));
2303 GetArgRCIdentityRoot(Retain) != Arg) {
2310 /// Look for an ``autorelease'' instruction dependent on Arg such that there are
2311 /// no instructions dependent on Arg that need a positive ref count in between
2314 FindPredecessorAutoreleaseWithSafePath(const Value *Arg, BasicBlock *BB,
2319 findSingleDependency(NeedsPositiveRetainCount, Arg, BB, Ret, PA));
2326 if (GetArgRCIdentityRoot(Autorelease) != Arg)
2353 const Value *Arg = GetRCIdentityRoot(Ret->getOperand(0));
2356 // dependent on Arg such that there are no instructions dependent on Arg
2359 FindPredecessorAutoreleaseWithSafePath(Arg, &BB, Ret, PA);
2365 Arg, Autorelease->getParent(), Autorelease, PA);
2372 CallInst *Call = HasSafePathToPredecessorCall(Arg, Retain, PA);