LLVM API Documentation

AliasAnalysis.cpp
Go to the documentation of this file.
00001 //===- AliasAnalysis.cpp - Generic Alias Analysis Interface Implementation -==//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the generic AliasAnalysis interface which is used as the
00011 // common interface used by all clients and implementations of alias analysis.
00012 //
00013 // This file also implements the default version of the AliasAnalysis interface
00014 // that is to be used when no other implementation is specified.  This does some
00015 // simple tests that detect obvious cases: two different global pointers cannot
00016 // alias, a global cannot alias a malloc, two different mallocs cannot alias,
00017 // etc.
00018 //
00019 // This alias analysis implementation really isn't very good for anything, but
00020 // it is very fast, and makes a nice clean default implementation.  Because it
00021 // handles lots of little corner cases, other, more complex, alias analysis
00022 // implementations may choose to rely on this pass to resolve these simple and
00023 // easy cases.
00024 //
00025 //===----------------------------------------------------------------------===//
00026 
00027 #include "llvm/Analysis/AliasAnalysis.h"
00028 #include "llvm/Analysis/CFG.h"
00029 #include "llvm/Analysis/CaptureTracking.h"
00030 #include "llvm/Analysis/ValueTracking.h"
00031 #include "llvm/IR/BasicBlock.h"
00032 #include "llvm/IR/DataLayout.h"
00033 #include "llvm/IR/Dominators.h"
00034 #include "llvm/IR/Function.h"
00035 #include "llvm/IR/Instructions.h"
00036 #include "llvm/IR/IntrinsicInst.h"
00037 #include "llvm/IR/LLVMContext.h"
00038 #include "llvm/IR/Type.h"
00039 #include "llvm/Pass.h"
00040 #include "llvm/Target/TargetLibraryInfo.h"
00041 using namespace llvm;
00042 
00043 // Register the AliasAnalysis interface, providing a nice name to refer to.
00044 INITIALIZE_ANALYSIS_GROUP(AliasAnalysis, "Alias Analysis", NoAA)
00045 char AliasAnalysis::ID = 0;
00046 
00047 //===----------------------------------------------------------------------===//
00048 // Default chaining methods
00049 //===----------------------------------------------------------------------===//
00050 
00051 AliasAnalysis::AliasResult
00052 AliasAnalysis::alias(const Location &LocA, const Location &LocB) {
00053   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00054   return AA->alias(LocA, LocB);
00055 }
00056 
00057 bool AliasAnalysis::pointsToConstantMemory(const Location &Loc,
00058                                            bool OrLocal) {
00059   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00060   return AA->pointsToConstantMemory(Loc, OrLocal);
00061 }
00062 
00063 AliasAnalysis::Location
00064 AliasAnalysis::getArgLocation(ImmutableCallSite CS, unsigned ArgIdx,
00065                               AliasAnalysis::ModRefResult &Mask) {
00066   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00067   return AA->getArgLocation(CS, ArgIdx, Mask);
00068 }
00069 
00070 void AliasAnalysis::deleteValue(Value *V) {
00071   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00072   AA->deleteValue(V);
00073 }
00074 
00075 void AliasAnalysis::copyValue(Value *From, Value *To) {
00076   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00077   AA->copyValue(From, To);
00078 }
00079 
00080 void AliasAnalysis::addEscapingUse(Use &U) {
00081   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00082   AA->addEscapingUse(U);
00083 }
00084 
00085 
00086 AliasAnalysis::ModRefResult
00087 AliasAnalysis::getModRefInfo(ImmutableCallSite CS,
00088                              const Location &Loc) {
00089   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00090 
00091   ModRefBehavior MRB = getModRefBehavior(CS);
00092   if (MRB == DoesNotAccessMemory)
00093     return NoModRef;
00094 
00095   ModRefResult Mask = ModRef;
00096   if (onlyReadsMemory(MRB))
00097     Mask = Ref;
00098 
00099   if (onlyAccessesArgPointees(MRB)) {
00100     bool doesAlias = false;
00101     ModRefResult AllArgsMask = NoModRef;
00102     if (doesAccessArgPointees(MRB)) {
00103       for (ImmutableCallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
00104            AI != AE; ++AI) {
00105         const Value *Arg = *AI;
00106         if (!Arg->getType()->isPointerTy())
00107           continue;
00108         ModRefResult ArgMask;
00109         Location CSLoc =
00110           getArgLocation(CS, (unsigned) std::distance(CS.arg_begin(), AI),
00111                          ArgMask);
00112         if (!isNoAlias(CSLoc, Loc)) {
00113           doesAlias = true;
00114           AllArgsMask = ModRefResult(AllArgsMask | ArgMask);
00115         }
00116       }
00117     }
00118     if (!doesAlias)
00119       return NoModRef;
00120     Mask = ModRefResult(Mask & AllArgsMask);
00121   }
00122 
00123   // If Loc is a constant memory location, the call definitely could not
00124   // modify the memory location.
00125   if ((Mask & Mod) && pointsToConstantMemory(Loc))
00126     Mask = ModRefResult(Mask & ~Mod);
00127 
00128   // If this is the end of the chain, don't forward.
00129   if (!AA) return Mask;
00130 
00131   // Otherwise, fall back to the next AA in the chain. But we can merge
00132   // in any mask we've managed to compute.
00133   return ModRefResult(AA->getModRefInfo(CS, Loc) & Mask);
00134 }
00135 
00136 AliasAnalysis::ModRefResult
00137 AliasAnalysis::getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) {
00138   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00139 
00140   // If CS1 or CS2 are readnone, they don't interact.
00141   ModRefBehavior CS1B = getModRefBehavior(CS1);
00142   if (CS1B == DoesNotAccessMemory) return NoModRef;
00143 
00144   ModRefBehavior CS2B = getModRefBehavior(CS2);
00145   if (CS2B == DoesNotAccessMemory) return NoModRef;
00146 
00147   // If they both only read from memory, there is no dependence.
00148   if (onlyReadsMemory(CS1B) && onlyReadsMemory(CS2B))
00149     return NoModRef;
00150 
00151   AliasAnalysis::ModRefResult Mask = ModRef;
00152 
00153   // If CS1 only reads memory, the only dependence on CS2 can be
00154   // from CS1 reading memory written by CS2.
00155   if (onlyReadsMemory(CS1B))
00156     Mask = ModRefResult(Mask & Ref);
00157 
00158   // If CS2 only access memory through arguments, accumulate the mod/ref
00159   // information from CS1's references to the memory referenced by
00160   // CS2's arguments.
00161   if (onlyAccessesArgPointees(CS2B)) {
00162     AliasAnalysis::ModRefResult R = NoModRef;
00163     if (doesAccessArgPointees(CS2B)) {
00164       for (ImmutableCallSite::arg_iterator
00165            I = CS2.arg_begin(), E = CS2.arg_end(); I != E; ++I) {
00166         const Value *Arg = *I;
00167         if (!Arg->getType()->isPointerTy())
00168           continue;
00169         ModRefResult ArgMask;
00170         Location CS2Loc =
00171           getArgLocation(CS2, (unsigned) std::distance(CS2.arg_begin(), I),
00172                          ArgMask);
00173         // ArgMask indicates what CS2 might do to CS2Loc, and the dependence of
00174         // CS1 on that location is the inverse.
00175         if (ArgMask == Mod)
00176           ArgMask = ModRef;
00177         else if (ArgMask == Ref)
00178           ArgMask = Mod;
00179 
00180         R = ModRefResult((R | (getModRefInfo(CS1, CS2Loc) & ArgMask)) & Mask);
00181         if (R == Mask)
00182           break;
00183       }
00184     }
00185     return R;
00186   }
00187 
00188   // If CS1 only accesses memory through arguments, check if CS2 references
00189   // any of the memory referenced by CS1's arguments. If not, return NoModRef.
00190   if (onlyAccessesArgPointees(CS1B)) {
00191     AliasAnalysis::ModRefResult R = NoModRef;
00192     if (doesAccessArgPointees(CS1B)) {
00193       for (ImmutableCallSite::arg_iterator
00194            I = CS1.arg_begin(), E = CS1.arg_end(); I != E; ++I) {
00195         const Value *Arg = *I;
00196         if (!Arg->getType()->isPointerTy())
00197           continue;
00198         ModRefResult ArgMask;
00199         Location CS1Loc = getArgLocation(
00200             CS1, (unsigned)std::distance(CS1.arg_begin(), I), ArgMask);
00201         // ArgMask indicates what CS1 might do to CS1Loc; if CS1 might Mod
00202         // CS1Loc, then we care about either a Mod or a Ref by CS2. If CS1
00203         // might Ref, then we care only about a Mod by CS2.
00204         ModRefResult ArgR = getModRefInfo(CS2, CS1Loc);
00205         if (((ArgMask & Mod) != NoModRef && (ArgR & ModRef) != NoModRef) ||
00206             ((ArgMask & Ref) != NoModRef && (ArgR & Mod)    != NoModRef))
00207           R = ModRefResult((R | ArgMask) & Mask);
00208 
00209         if (R == Mask)
00210           break;
00211       }
00212     }
00213     return R;
00214   }
00215 
00216   // If this is the end of the chain, don't forward.
00217   if (!AA) return Mask;
00218 
00219   // Otherwise, fall back to the next AA in the chain. But we can merge
00220   // in any mask we've managed to compute.
00221   return ModRefResult(AA->getModRefInfo(CS1, CS2) & Mask);
00222 }
00223 
00224 AliasAnalysis::ModRefBehavior
00225 AliasAnalysis::getModRefBehavior(ImmutableCallSite CS) {
00226   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00227 
00228   ModRefBehavior Min = UnknownModRefBehavior;
00229 
00230   // Call back into the alias analysis with the other form of getModRefBehavior
00231   // to see if it can give a better response.
00232   if (const Function *F = CS.getCalledFunction())
00233     Min = getModRefBehavior(F);
00234 
00235   // If this is the end of the chain, don't forward.
00236   if (!AA) return Min;
00237 
00238   // Otherwise, fall back to the next AA in the chain. But we can merge
00239   // in any result we've managed to compute.
00240   return ModRefBehavior(AA->getModRefBehavior(CS) & Min);
00241 }
00242 
00243 AliasAnalysis::ModRefBehavior
00244 AliasAnalysis::getModRefBehavior(const Function *F) {
00245   assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!");
00246   return AA->getModRefBehavior(F);
00247 }
00248 
00249 //===----------------------------------------------------------------------===//
00250 // AliasAnalysis non-virtual helper method implementation
00251 //===----------------------------------------------------------------------===//
00252 
00253 AliasAnalysis::Location AliasAnalysis::getLocation(const LoadInst *LI) {
00254   AAMDNodes AATags;
00255   LI->getAAMetadata(AATags);
00256 
00257   return Location(LI->getPointerOperand(),
00258                   getTypeStoreSize(LI->getType()), AATags);
00259 }
00260 
00261 AliasAnalysis::Location AliasAnalysis::getLocation(const StoreInst *SI) {
00262   AAMDNodes AATags;
00263   SI->getAAMetadata(AATags);
00264 
00265   return Location(SI->getPointerOperand(),
00266                   getTypeStoreSize(SI->getValueOperand()->getType()), AATags);
00267 }
00268 
00269 AliasAnalysis::Location AliasAnalysis::getLocation(const VAArgInst *VI) {
00270   AAMDNodes AATags;
00271   VI->getAAMetadata(AATags);
00272 
00273   return Location(VI->getPointerOperand(), UnknownSize, AATags);
00274 }
00275 
00276 AliasAnalysis::Location
00277 AliasAnalysis::getLocation(const AtomicCmpXchgInst *CXI) {
00278   AAMDNodes AATags;
00279   CXI->getAAMetadata(AATags);
00280 
00281   return Location(CXI->getPointerOperand(),
00282                   getTypeStoreSize(CXI->getCompareOperand()->getType()),
00283                   AATags);
00284 }
00285 
00286 AliasAnalysis::Location
00287 AliasAnalysis::getLocation(const AtomicRMWInst *RMWI) {
00288   AAMDNodes AATags;
00289   RMWI->getAAMetadata(AATags);
00290 
00291   return Location(RMWI->getPointerOperand(),
00292                   getTypeStoreSize(RMWI->getValOperand()->getType()), AATags);
00293 }
00294 
00295 AliasAnalysis::Location
00296 AliasAnalysis::getLocationForSource(const MemTransferInst *MTI) {
00297   uint64_t Size = UnknownSize;
00298   if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
00299     Size = C->getValue().getZExtValue();
00300 
00301   // memcpy/memmove can have AA tags. For memcpy, they apply
00302   // to both the source and the destination.
00303   AAMDNodes AATags;
00304   MTI->getAAMetadata(AATags);
00305 
00306   return Location(MTI->getRawSource(), Size, AATags);
00307 }
00308 
00309 AliasAnalysis::Location
00310 AliasAnalysis::getLocationForDest(const MemIntrinsic *MTI) {
00311   uint64_t Size = UnknownSize;
00312   if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
00313     Size = C->getValue().getZExtValue();
00314 
00315   // memcpy/memmove can have AA tags. For memcpy, they apply
00316   // to both the source and the destination.
00317   AAMDNodes AATags;
00318   MTI->getAAMetadata(AATags);
00319 
00320   return Location(MTI->getRawDest(), Size, AATags);
00321 }
00322 
00323 
00324 
00325 AliasAnalysis::ModRefResult
00326 AliasAnalysis::getModRefInfo(const LoadInst *L, const Location &Loc) {
00327   // Be conservative in the face of volatile/atomic.
00328   if (!L->isUnordered())
00329     return ModRef;
00330 
00331   // If the load address doesn't alias the given address, it doesn't read
00332   // or write the specified memory.
00333   if (!alias(getLocation(L), Loc))
00334     return NoModRef;
00335 
00336   // Otherwise, a load just reads.
00337   return Ref;
00338 }
00339 
00340 AliasAnalysis::ModRefResult
00341 AliasAnalysis::getModRefInfo(const StoreInst *S, const Location &Loc) {
00342   // Be conservative in the face of volatile/atomic.
00343   if (!S->isUnordered())
00344     return ModRef;
00345 
00346   // If the store address cannot alias the pointer in question, then the
00347   // specified memory cannot be modified by the store.
00348   if (!alias(getLocation(S), Loc))
00349     return NoModRef;
00350 
00351   // If the pointer is a pointer to constant memory, then it could not have been
00352   // modified by this store.
00353   if (pointsToConstantMemory(Loc))
00354     return NoModRef;
00355 
00356   // Otherwise, a store just writes.
00357   return Mod;
00358 }
00359 
00360 AliasAnalysis::ModRefResult
00361 AliasAnalysis::getModRefInfo(const VAArgInst *V, const Location &Loc) {
00362   // If the va_arg address cannot alias the pointer in question, then the
00363   // specified memory cannot be accessed by the va_arg.
00364   if (!alias(getLocation(V), Loc))
00365     return NoModRef;
00366 
00367   // If the pointer is a pointer to constant memory, then it could not have been
00368   // modified by this va_arg.
00369   if (pointsToConstantMemory(Loc))
00370     return NoModRef;
00371 
00372   // Otherwise, a va_arg reads and writes.
00373   return ModRef;
00374 }
00375 
00376 AliasAnalysis::ModRefResult
00377 AliasAnalysis::getModRefInfo(const AtomicCmpXchgInst *CX, const Location &Loc) {
00378   // Acquire/Release cmpxchg has properties that matter for arbitrary addresses.
00379   if (CX->getSuccessOrdering() > Monotonic)
00380     return ModRef;
00381 
00382   // If the cmpxchg address does not alias the location, it does not access it.
00383   if (!alias(getLocation(CX), Loc))
00384     return NoModRef;
00385 
00386   return ModRef;
00387 }
00388 
00389 AliasAnalysis::ModRefResult
00390 AliasAnalysis::getModRefInfo(const AtomicRMWInst *RMW, const Location &Loc) {
00391   // Acquire/Release atomicrmw has properties that matter for arbitrary addresses.
00392   if (RMW->getOrdering() > Monotonic)
00393     return ModRef;
00394 
00395   // If the atomicrmw address does not alias the location, it does not access it.
00396   if (!alias(getLocation(RMW), Loc))
00397     return NoModRef;
00398 
00399   return ModRef;
00400 }
00401 
00402 // FIXME: this is really just shoring-up a deficiency in alias analysis.
00403 // BasicAA isn't willing to spend linear time determining whether an alloca
00404 // was captured before or after this particular call, while we are. However,
00405 // with a smarter AA in place, this test is just wasting compile time.
00406 AliasAnalysis::ModRefResult
00407 AliasAnalysis::callCapturesBefore(const Instruction *I,
00408                                   const AliasAnalysis::Location &MemLoc,
00409                                   DominatorTree *DT) {
00410   if (!DT || !DL) return AliasAnalysis::ModRef;
00411 
00412   const Value *Object = GetUnderlyingObject(MemLoc.Ptr, DL);
00413   if (!isIdentifiedObject(Object) || isa<GlobalValue>(Object) ||
00414       isa<Constant>(Object))
00415     return AliasAnalysis::ModRef;
00416 
00417   ImmutableCallSite CS(I);
00418   if (!CS.getInstruction() || CS.getInstruction() == Object)
00419     return AliasAnalysis::ModRef;
00420 
00421   if (llvm::PointerMayBeCapturedBefore(Object, /* ReturnCaptures */ true,
00422                                        /* StoreCaptures */ true, I, DT,
00423                                        /* include Object */ true))
00424     return AliasAnalysis::ModRef;
00425 
00426   unsigned ArgNo = 0;
00427   AliasAnalysis::ModRefResult R = AliasAnalysis::NoModRef;
00428   for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
00429        CI != CE; ++CI, ++ArgNo) {
00430     // Only look at the no-capture or byval pointer arguments.  If this
00431     // pointer were passed to arguments that were neither of these, then it
00432     // couldn't be no-capture.
00433     if (!(*CI)->getType()->isPointerTy() ||
00434         (!CS.doesNotCapture(ArgNo) && !CS.isByValArgument(ArgNo)))
00435       continue;
00436 
00437     // If this is a no-capture pointer argument, see if we can tell that it
00438     // is impossible to alias the pointer we're checking.  If not, we have to
00439     // assume that the call could touch the pointer, even though it doesn't
00440     // escape.
00441     if (isNoAlias(AliasAnalysis::Location(*CI),
00442                   AliasAnalysis::Location(Object)))
00443       continue;
00444     if (CS.doesNotAccessMemory(ArgNo))
00445       continue;
00446     if (CS.onlyReadsMemory(ArgNo)) {
00447       R = AliasAnalysis::Ref;
00448       continue;
00449     }
00450     return AliasAnalysis::ModRef;
00451   }
00452   return R;
00453 }
00454 
00455 // AliasAnalysis destructor: DO NOT move this to the header file for
00456 // AliasAnalysis or else clients of the AliasAnalysis class may not depend on
00457 // the AliasAnalysis.o file in the current .a file, causing alias analysis
00458 // support to not be included in the tool correctly!
00459 //
00460 AliasAnalysis::~AliasAnalysis() {}
00461 
00462 /// InitializeAliasAnalysis - Subclasses must call this method to initialize the
00463 /// AliasAnalysis interface before any other methods are called.
00464 ///
00465 void AliasAnalysis::InitializeAliasAnalysis(Pass *P) {
00466   DataLayoutPass *DLP = P->getAnalysisIfAvailable<DataLayoutPass>();
00467   DL = DLP ? &DLP->getDataLayout() : nullptr;
00468   TLI = P->getAnalysisIfAvailable<TargetLibraryInfo>();
00469   AA = &P->getAnalysis<AliasAnalysis>();
00470 }
00471 
00472 // getAnalysisUsage - All alias analysis implementations should invoke this
00473 // directly (using AliasAnalysis::getAnalysisUsage(AU)).
00474 void AliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
00475   AU.addRequired<AliasAnalysis>();         // All AA's chain
00476 }
00477 
00478 /// getTypeStoreSize - Return the DataLayout store size for the given type,
00479 /// if known, or a conservative value otherwise.
00480 ///
00481 uint64_t AliasAnalysis::getTypeStoreSize(Type *Ty) {
00482   return DL ? DL->getTypeStoreSize(Ty) : UnknownSize;
00483 }
00484 
00485 /// canBasicBlockModify - Return true if it is possible for execution of the
00486 /// specified basic block to modify the location Loc.
00487 ///
00488 bool AliasAnalysis::canBasicBlockModify(const BasicBlock &BB,
00489                                         const Location &Loc) {
00490   return canInstructionRangeModRef(BB.front(), BB.back(), Loc, Mod);
00491 }
00492 
00493 /// canInstructionRangeModRef - Return true if it is possible for the
00494 /// execution of the specified instructions to mod\ref (according to the
00495 /// mode) the location Loc. The instructions to consider are all
00496 /// of the instructions in the range of [I1,I2] INCLUSIVE.
00497 /// I1 and I2 must be in the same basic block.  
00498 bool AliasAnalysis::canInstructionRangeModRef(const Instruction &I1,
00499                                               const Instruction &I2,
00500                                               const Location &Loc,
00501                                               const ModRefResult Mode) {
00502   assert(I1.getParent() == I2.getParent() &&
00503          "Instructions not in same basic block!");
00504   BasicBlock::const_iterator I = &I1;
00505   BasicBlock::const_iterator E = &I2;
00506   ++E;  // Convert from inclusive to exclusive range.
00507 
00508   for (; I != E; ++I) // Check every instruction in range
00509     if (getModRefInfo(I, Loc) & Mode)
00510       return true;
00511   return false;
00512 }
00513 
00514 /// isNoAliasCall - Return true if this pointer is returned by a noalias
00515 /// function.
00516 bool llvm::isNoAliasCall(const Value *V) {
00517   if (isa<CallInst>(V) || isa<InvokeInst>(V))
00518     return ImmutableCallSite(cast<Instruction>(V))
00519       .paramHasAttr(0, Attribute::NoAlias);
00520   return false;
00521 }
00522 
00523 /// isNoAliasArgument - Return true if this is an argument with the noalias
00524 /// attribute.
00525 bool llvm::isNoAliasArgument(const Value *V)
00526 {
00527   if (const Argument *A = dyn_cast<Argument>(V))
00528     return A->hasNoAliasAttr();
00529   return false;
00530 }
00531 
00532 /// isIdentifiedObject - Return true if this pointer refers to a distinct and
00533 /// identifiable object.  This returns true for:
00534 ///    Global Variables and Functions (but not Global Aliases)
00535 ///    Allocas and Mallocs
00536 ///    ByVal and NoAlias Arguments
00537 ///    NoAlias returns
00538 ///
00539 bool llvm::isIdentifiedObject(const Value *V) {
00540   if (isa<AllocaInst>(V))
00541     return true;
00542   if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V))
00543     return true;
00544   if (isNoAliasCall(V))
00545     return true;
00546   if (const Argument *A = dyn_cast<Argument>(V))
00547     return A->hasNoAliasAttr() || A->hasByValAttr();
00548   return false;
00549 }
00550 
00551 /// isIdentifiedFunctionLocal - Return true if V is umabigously identified
00552 /// at the function-level. Different IdentifiedFunctionLocals can't alias.
00553 /// Further, an IdentifiedFunctionLocal can not alias with any function
00554 /// arguments other than itself, which is not necessarily true for
00555 /// IdentifiedObjects.
00556 bool llvm::isIdentifiedFunctionLocal(const Value *V)
00557 {
00558   return isa<AllocaInst>(V) || isNoAliasCall(V) || isNoAliasArgument(V);
00559 }