Lines Matching refs:Value
170 /// IsPotentialUse - Test whether the given value is possible a
172 static bool IsPotentialUse(const Value *Op) {
274 static InstructionClass GetInstructionClass(const Value *V) {
365 static InstructionClass GetBasicInstructionClass(const Value *V) {
440 /// argument verbatim, so if it's such a call and the return value has users,
441 /// replace them with the argument value.
443 Value *OldArg = cast<CallInst>(CI)->getArgOperand(0);
448 // Replace the return value with the argument.
463 static const Value *GetUnderlyingObjCPtr(const Value *V) {
475 /// Value::stripPointerCasts which also knows how to look through objc_retain
477 static const Value *StripPointerCastsAndObjCCalls(const Value *V) {
488 /// Value::stripPointerCasts which also knows how to look through objc_retain
490 static Value *StripPointerCastsAndObjCCalls(Value *V) {
501 /// as objc_retain or objc_release, return the argument value, stripped of no-op
503 static Value *GetObjCArg(Value *Inst) {
510 static bool IsObjCIdentifiedObject(const Value *V) {
520 const Value *Pointer =
543 /// StripPointerCastsAndObjCCalls but it stops as soon as it finds a value
545 static const Value *FindSingleUseIdentifiedObject(const Value *Arg) {
562 // value.
564 for (Value::const_use_iterator UI = Arg->use_begin(), UE = Arg->use_end();
672 const Value *SA = StripPointerCastsAndObjCCalls(LocA.Ptr);
673 const Value *SB = StripPointerCastsAndObjCCalls(LocB.Ptr);
682 const Value *UA = GetUnderlyingObjCPtr(SA);
683 const Value *UB = GetUnderlyingObjCPtr(SB);
687 // GetUnderlyingObjCPtr may return an offsetted pointer value.
705 const Value *S = StripPointerCastsAndObjCCalls(Loc.Ptr);
712 const Value *U = GetUnderlyingObjCPtr(S);
905 STATISTIC(NumRets, "Number of return value forwarding "
917 typedef std::pair<const Value *, const Value *> ValuePairTy;
921 bool relatedCheck(const Value *A, const Value *B);
922 bool relatedSelect(const SelectInst *A, const Value *B);
923 bool relatedPHI(const PHINode *A, const Value *B);
936 bool related(const Value *A, const Value *B);
944 bool ProvenanceAnalysis::relatedSelect(const SelectInst *A, const Value *B) {
966 bool ProvenanceAnalysis::relatedPHI(const PHINode *A, const Value *B) {
980 SmallPtrSet<const Value *, 4> UniqueSrc;
982 const Value *PV1 = A->getIncomingValue(i);
991 /// isStoredObjCPointer - Test if the value of P, or any value covered by its
993 static bool isStoredObjCPointer(const Value *P) {
994 SmallPtrSet<const Value *, 8> Visited;
995 SmallVector<const Value *, 8> Worklist;
1000 for (Value::const_use_iterator UI = P->use_begin(), UE = P->use_end();
1025 bool ProvenanceAnalysis::relatedCheck(const Value *A, const Value *B) {
1077 bool ProvenanceAnalysis::related(const Value *A, const Value *B) {
1078 // Begin by inserting a conservative value into the map. If the insertion
1147 /// pair all on the known same pointer value can be eliminated, regardless
1330 typedef MapVector<const Value *, PtrState> MapTy;
1372 PtrState &getPtrTopDownState(const Value *Arg) {
1376 PtrState &getPtrBottomUpState(const Value *Arg) {
1512 MapVector<Value *, RRInfo> &Retains);
1515 DenseMap<Value *, RRInfo> &Releases);
1518 MapVector<Value *, RRInfo> &Retains,
1519 DenseMap<Value *, RRInfo> &Releases);
1521 void MoveCalls(Value *Arg, RRInfo &RetainsToMove, RRInfo &ReleasesToMove,
1522 MapVector<Value *, RRInfo> &Retains,
1523 DenseMap<Value *, RRInfo> &Releases,
1528 MapVector<Value *, RRInfo> &Retains,
1529 DenseMap<Value *, RRInfo> &Releases,
1672 CanAlterRefCount(const Instruction *Inst, const Value *Ptr,
1683 ImmutableCallSite CS = static_cast<const Value *>(Inst);
1693 const Value *Op = *I;
1707 CanUse(const Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA,
1721 } else if (ImmutableCallSite CS = static_cast<const Value *>(Inst)) {
1725 const Value *Op = *OI;
1731 // Special-case stores, because we don't care about the stored value, just
1733 const Value *Op = GetUnderlyingObjCPtr(SI->getPointerOperand());
1742 const Value *Op = *OI;
1782 Depends(DependenceKind Flavor, Instruction *Inst, const Value *Arg,
1859 const Value *Arg,
1917 static bool isNullOrUndef(const Value *V) {
1928 /// objc_retainAutoreleasedReturnValue if the operand is a return value.
1950 /// objc_retain if the operand is not a return value. Or, if it can be
1956 Value *Arg = GetObjCArg(RetainRV);
1990 /// objc_autorelease if the result is not used as a return value.
1993 // Check for a return of the pointer value.
1994 const Value *Ptr = GetObjCArg(AutoreleaseRV);
1995 SmallVector<const Value *, 2> Users;
1999 for (Value::const_use_iterator UI = Ptr->use_begin(), UE = Ptr->use_end();
2091 const Value *Arg = Call->getArgOperand(0);
2103 MDNode::get(C, ArrayRef<Value *>()));
2128 const Value *Arg = GetObjCArg(Inst);
2147 SmallVector<std::pair<Instruction *, const Value *>, 4> Worklist;
2150 std::pair<Instruction *, const Value *> Pair = Worklist.pop_back_val();
2162 Value *Incoming =
2186 // Clone the call into each predecessor that has a non-null value.
2190 Value *Incoming =
2194 Value *Op = PN->getIncomingValue(i);
2226 const Value *Arg = I->first;
2260 const Value *Arg = I->first;
2299 MapVector<Value *, RRInfo> &Retains) {
2335 const Value *Arg = 0;
2422 const Value *Ptr = MI->first;
2482 DenseMap<Value *, RRInfo> &Releases) {
2519 const Value *Arg = 0;
2601 const Value *Ptr = MI->first;
2668 MapVector<Value *, RRInfo> &Retains,
2669 DenseMap<Value *, RRInfo> &Releases) {
2712 void ObjCARCOpt::MoveCalls(Value *Arg,
2715 MapVector<Value *, RRInfo> &Retains,
2716 DenseMap<Value *, RRInfo> &Releases,
2727 Value *MyArg = ArgTy == ParamTy ? Arg :
2736 MDNode::get(M->getContext(), ArrayRef<Value *>()));
2748 // The invoke's return value isn't available in the unwind block,
2760 Value *MyArg = ArgTy == ParamTy ? Arg :
2793 MapVector<Value *, RRInfo> &Retains,
2794 DenseMap<Value *, RRInfo> &Releases,
2803 for (MapVector<Value *, RRInfo>::const_iterator I = Retains.begin(),
2805 Value *V = I->first;
2809 Value *Arg = GetObjCArg(Retain);
2851 MapVector<Value *, RRInfo>::const_iterator It = Retains.find(NewRetain);
2859 DenseMap<Value *, RRInfo>::const_iterator Jt =
2906 DenseMap<Value *, RRInfo>::const_iterator It =
2915 MapVector<Value *, RRInfo>::const_iterator Jt =
3024 // TODO: For now, just look for an earlier available version of this value
3038 // If this is loading from the same pointer, replace this load's value
3042 Value *Arg = Call->getArgOperand(0);
3043 Value *EarlierArg = EarlierCall->getArgOperand(0);
3069 // replace this load's value with the stored value.
3072 Value *Arg = Call->getArgOperand(0);
3073 Value *EarlierArg = EarlierCall->getArgOperand(0);
3098 // TOOD: Grab the copied value.
3123 Value *Arg = Call->getArgOperand(0);
3125 for (Value::use_iterator UI = Alloca->use_begin(),
3138 for (Value::use_iterator UI = Alloca->use_begin(),
3155 /// analysis. These use Value* as the key instead of Instruction* so that the
3158 DenseMap<Value *, RRInfo> Releases;
3159 MapVector<Value *, RRInfo> Retains;
3199 const Value *Arg = StripPointerCastsAndObjCCalls(Ret->getOperand(0));
3241 // returning the value.
3259 // Check that the pointer is the return value of the call.
3298 // they are not, because they return their argument value. And objc_release
3505 const Value *Arg = GetObjCArg(Autorelease);
3571 Value *New = StripPointerCastsAndObjCCalls(Store->getValueOperand());
3589 Value *Args[] = { Load->getPointerOperand(), New };
3647 // argument with uses of the call return value, if it dominates the use. This
3690 Value *Null =
3708 const Value *Arg = cast<CallInst>(Inst)->getArgOperand(0);
3714 for (Value::const_use_iterator UI = Arg->use_begin(), UE = Arg->use_end();