[CaptureTracker] Provide an ordered basic block to PointerMayBeCapturedBefore
[oota-llvm.git] / include / llvm / Analysis / AliasAnalysis.h
1 //===- llvm/Analysis/AliasAnalysis.h - Alias Analysis Interface -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the generic AliasAnalysis interface, which is used as the
11 // common interface used by all clients of alias analysis information, and
12 // implemented by all alias analysis implementations.  Mod/Ref information is
13 // also captured by this interface.
14 //
15 // Implementations of this interface must implement the various virtual methods,
16 // which automatically provides functionality for the entire suite of client
17 // APIs.
18 //
19 // This API identifies memory regions with the MemoryLocation class. The pointer
20 // component specifies the base memory address of the region. The Size specifies
21 // the maximum size (in address units) of the memory region, or
22 // MemoryLocation::UnknownSize if the size is not known. The TBAA tag
23 // identifies the "type" of the memory reference; see the
24 // TypeBasedAliasAnalysis class for details.
25 //
26 // Some non-obvious details include:
27 //  - Pointers that point to two completely different objects in memory never
28 //    alias, regardless of the value of the Size component.
29 //  - NoAlias doesn't imply inequal pointers. The most obvious example of this
30 //    is two pointers to constant memory. Even if they are equal, constant
31 //    memory is never stored to, so there will never be any dependencies.
32 //    In this and other situations, the pointers may be both NoAlias and
33 //    MustAlias at the same time. The current API can only return one result,
34 //    though this is rarely a problem in practice.
35 //
36 //===----------------------------------------------------------------------===//
37
38 #ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
39 #define LLVM_ANALYSIS_ALIASANALYSIS_H
40
41 #include "llvm/ADT/DenseMap.h"
42 #include "llvm/IR/CallSite.h"
43 #include "llvm/IR/Metadata.h"
44 #include "llvm/Analysis/MemoryLocation.h"
45
46 namespace llvm {
47
48 class LoadInst;
49 class StoreInst;
50 class VAArgInst;
51 class DataLayout;
52 class TargetLibraryInfo;
53 class Pass;
54 class AnalysisUsage;
55 class MemTransferInst;
56 class MemIntrinsic;
57 class DominatorTree;
58 class OrderedBasicBlock;
59
60 /// The possible results of an alias query.
61 ///
62 /// These results are always computed between two MemoryLocation objects as
63 /// a query to some alias analysis.
64 ///
65 /// Note that these are unscoped enumerations because we would like to support
66 /// implicitly testing a result for the existence of any possible aliasing with
67 /// a conversion to bool, but an "enum class" doesn't support this. The
68 /// canonical names from the literature are suffixed and unique anyways, and so
69 /// they serve as global constants in LLVM for these results.
70 ///
71 /// See docs/AliasAnalysis.html for more information on the specific meanings
72 /// of these values.
73 enum AliasResult {
74   /// The two locations do not alias at all.
75   ///
76   /// This value is arranged to convert to false, while all other values
77   /// convert to true. This allows a boolean context to convert the result to
78   /// a binary flag indicating whether there is the possibility of aliasing.
79   NoAlias = 0,
80   /// The two locations may or may not alias. This is the least precise result.
81   MayAlias,
82   /// The two locations alias, but only due to a partial overlap.
83   PartialAlias,
84   /// The two locations precisely alias each other.
85   MustAlias,
86 };
87
88 /// Flags indicating whether a memory access modifies or references memory.
89 ///
90 /// This is no access at all, a modification, a reference, or both
91 /// a modification and a reference. These are specifically structured such that
92 /// they form a two bit matrix and bit-tests for 'mod' or 'ref' work with any
93 /// of the possible values.
94 enum ModRefInfo {
95   /// The access neither references nor modifies the value stored in memory.
96   MRI_NoModRef = 0,
97   /// The access references the value stored in memory.
98   MRI_Ref = 1,
99   /// The access modifies the value stored in memory.
100   MRI_Mod = 2,
101   /// The access both references and modifies the value stored in memory.
102   MRI_ModRef = MRI_Ref | MRI_Mod
103 };
104
105 /// The locations at which a function might access memory.
106 ///
107 /// These are primarily used in conjunction with the \c AccessKind bits to
108 /// describe both the nature of access and the locations of access for a
109 /// function call.
110 enum FunctionModRefLocation {
111   /// Base case is no access to memory.
112   FMRL_Nowhere = 0,
113   /// Access to memory via argument pointers.
114   FMRL_ArgumentPointees = 4,
115   /// Access to any memory.
116   FMRL_Anywhere = 8 | FMRL_ArgumentPointees
117 };
118
119 /// Summary of how a function affects memory in the program.
120 ///
121 /// Loads from constant globals are not considered memory accesses for this
122 /// interface. Also, functions may freely modify stack space local to their
123 /// invocation without having to report it through these interfaces.
124 enum FunctionModRefBehavior {
125   /// This function does not perform any non-local loads or stores to memory.
126   ///
127   /// This property corresponds to the GCC 'const' attribute.
128   /// This property corresponds to the LLVM IR 'readnone' attribute.
129   /// This property corresponds to the IntrNoMem LLVM intrinsic flag.
130   FMRB_DoesNotAccessMemory = FMRL_Nowhere | MRI_NoModRef,
131
132   /// The only memory references in this function (if it has any) are
133   /// non-volatile loads from objects pointed to by its pointer-typed
134   /// arguments, with arbitrary offsets.
135   ///
136   /// This property corresponds to the IntrReadArgMem LLVM intrinsic flag.
137   FMRB_OnlyReadsArgumentPointees = FMRL_ArgumentPointees | MRI_Ref,
138
139   /// The only memory references in this function (if it has any) are
140   /// non-volatile loads and stores from objects pointed to by its
141   /// pointer-typed arguments, with arbitrary offsets.
142   ///
143   /// This property corresponds to the IntrReadWriteArgMem LLVM intrinsic flag.
144   FMRB_OnlyAccessesArgumentPointees = FMRL_ArgumentPointees | MRI_ModRef,
145
146   /// This function does not perform any non-local stores or volatile loads,
147   /// but may read from any memory location.
148   ///
149   /// This property corresponds to the GCC 'pure' attribute.
150   /// This property corresponds to the LLVM IR 'readonly' attribute.
151   /// This property corresponds to the IntrReadMem LLVM intrinsic flag.
152   FMRB_OnlyReadsMemory = FMRL_Anywhere | MRI_Ref,
153
154   /// This indicates that the function could not be classified into one of the
155   /// behaviors above.
156   FMRB_UnknownModRefBehavior = FMRL_Anywhere | MRI_ModRef
157 };
158
159 class AliasAnalysis {
160 protected:
161   const DataLayout *DL;
162   const TargetLibraryInfo *TLI;
163
164 private:
165   AliasAnalysis *AA;       // Previous Alias Analysis to chain to.
166
167 protected:
168   /// InitializeAliasAnalysis - Subclasses must call this method to initialize
169   /// the AliasAnalysis interface before any other methods are called.  This is
170   /// typically called by the run* methods of these subclasses.  This may be
171   /// called multiple times.
172   ///
173   void InitializeAliasAnalysis(Pass *P, const DataLayout *DL);
174
175   /// getAnalysisUsage - All alias analysis implementations should invoke this
176   /// directly (using AliasAnalysis::getAnalysisUsage(AU)).
177   virtual void getAnalysisUsage(AnalysisUsage &AU) const;
178
179 public:
180   static char ID; // Class identification, replacement for typeinfo
181   AliasAnalysis() : DL(nullptr), TLI(nullptr), AA(nullptr) {}
182   virtual ~AliasAnalysis();  // We want to be subclassed
183
184   /// getTargetLibraryInfo - Return a pointer to the current TargetLibraryInfo
185   /// object, or null if no TargetLibraryInfo object is available.
186   ///
187   const TargetLibraryInfo *getTargetLibraryInfo() const { return TLI; }
188
189   /// getTypeStoreSize - Return the DataLayout store size for the given type,
190   /// if known, or a conservative value otherwise.
191   ///
192   uint64_t getTypeStoreSize(Type *Ty);
193
194   //===--------------------------------------------------------------------===//
195   /// \name Alias Queries
196   /// @{
197
198   /// The main low level interface to the alias analysis implementation.
199   /// Returns an AliasResult indicating whether the two pointers are aliased to
200   /// each other. This is the interface that must be implemented by specific
201   /// alias analysis implementations.
202   virtual AliasResult alias(const MemoryLocation &LocA,
203                             const MemoryLocation &LocB);
204
205   /// A convenience wrapper around the primary \c alias interface.
206   AliasResult alias(const Value *V1, uint64_t V1Size, const Value *V2,
207                     uint64_t V2Size) {
208     return alias(MemoryLocation(V1, V1Size), MemoryLocation(V2, V2Size));
209   }
210
211   /// A convenience wrapper around the primary \c alias interface.
212   AliasResult alias(const Value *V1, const Value *V2) {
213     return alias(V1, MemoryLocation::UnknownSize, V2,
214                  MemoryLocation::UnknownSize);
215   }
216
217   /// A trivial helper function to check to see if the specified pointers are
218   /// no-alias.
219   bool isNoAlias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
220     return alias(LocA, LocB) == NoAlias;
221   }
222
223   /// A convenience wrapper around the \c isNoAlias helper interface.
224   bool isNoAlias(const Value *V1, uint64_t V1Size, const Value *V2,
225                  uint64_t V2Size) {
226     return isNoAlias(MemoryLocation(V1, V1Size), MemoryLocation(V2, V2Size));
227   }
228
229   /// A convenience wrapper around the \c isNoAlias helper interface.
230   bool isNoAlias(const Value *V1, const Value *V2) {
231     return isNoAlias(MemoryLocation(V1), MemoryLocation(V2));
232   }
233
234   /// A trivial helper function to check to see if the specified pointers are
235   /// must-alias.
236   bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
237     return alias(LocA, LocB) == MustAlias;
238   }
239
240   /// A convenience wrapper around the \c isMustAlias helper interface.
241   bool isMustAlias(const Value *V1, const Value *V2) {
242     return alias(V1, 1, V2, 1) == MustAlias;
243   }
244
245   /// Checks whether the given location points to constant memory, or if
246   /// \p OrLocal is true whether it points to a local alloca.
247   virtual bool pointsToConstantMemory(const MemoryLocation &Loc,
248                                       bool OrLocal = false);
249
250   /// A convenience wrapper around the primary \c pointsToConstantMemory
251   /// interface.
252   bool pointsToConstantMemory(const Value *P, bool OrLocal = false) {
253     return pointsToConstantMemory(MemoryLocation(P), OrLocal);
254   }
255
256   /// @}
257   //===--------------------------------------------------------------------===//
258   /// \name Simple mod/ref information
259   /// @{
260
261   /// Get the ModRef info associated with a pointer argument of a callsite. The
262   /// result's bits are set to indicate the allowed aliasing ModRef kinds. Note
263   /// that these bits do not necessarily account for the overall behavior of
264   /// the function, but rather only provide additional per-argument
265   /// information.
266   virtual ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx);
267
268   /// Return the behavior of the given call site.
269   virtual FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS);
270
271   /// Return the behavior when calling the given function.
272   virtual FunctionModRefBehavior getModRefBehavior(const Function *F);
273
274   /// Checks if the specified call is known to never read or write memory.
275   ///
276   /// Note that if the call only reads from known-constant memory, it is also
277   /// legal to return true. Also, calls that unwind the stack are legal for
278   /// this predicate.
279   ///
280   /// Many optimizations (such as CSE and LICM) can be performed on such calls
281   /// without worrying about aliasing properties, and many calls have this
282   /// property (e.g. calls to 'sin' and 'cos').
283   ///
284   /// This property corresponds to the GCC 'const' attribute.
285   bool doesNotAccessMemory(ImmutableCallSite CS) {
286     return getModRefBehavior(CS) == FMRB_DoesNotAccessMemory;
287   }
288
289   /// Checks if the specified function is known to never read or write memory.
290   ///
291   /// Note that if the function only reads from known-constant memory, it is
292   /// also legal to return true. Also, function that unwind the stack are legal
293   /// for this predicate.
294   ///
295   /// Many optimizations (such as CSE and LICM) can be performed on such calls
296   /// to such functions without worrying about aliasing properties, and many
297   /// functions have this property (e.g. 'sin' and 'cos').
298   ///
299   /// This property corresponds to the GCC 'const' attribute.
300   bool doesNotAccessMemory(const Function *F) {
301     return getModRefBehavior(F) == FMRB_DoesNotAccessMemory;
302   }
303
304   /// Checks if the specified call is known to only read from non-volatile
305   /// memory (or not access memory at all).
306   ///
307   /// Calls that unwind the stack are legal for this predicate.
308   ///
309   /// This property allows many common optimizations to be performed in the
310   /// absence of interfering store instructions, such as CSE of strlen calls.
311   ///
312   /// This property corresponds to the GCC 'pure' attribute.
313   bool onlyReadsMemory(ImmutableCallSite CS) {
314     return onlyReadsMemory(getModRefBehavior(CS));
315   }
316
317   /// Checks if the specified function is known to only read from non-volatile
318   /// memory (or not access memory at all).
319   ///
320   /// Functions that unwind the stack are legal for this predicate.
321   ///
322   /// This property allows many common optimizations to be performed in the
323   /// absence of interfering store instructions, such as CSE of strlen calls.
324   ///
325   /// This property corresponds to the GCC 'pure' attribute.
326   bool onlyReadsMemory(const Function *F) {
327     return onlyReadsMemory(getModRefBehavior(F));
328   }
329
330   /// Checks if functions with the specified behavior are known to only read
331   /// from non-volatile memory (or not access memory at all).
332   static bool onlyReadsMemory(FunctionModRefBehavior MRB) {
333     return !(MRB & MRI_Mod);
334   }
335
336   /// Checks if functions with the specified behavior are known to read and
337   /// write at most from objects pointed to by their pointer-typed arguments
338   /// (with arbitrary offsets).
339   static bool onlyAccessesArgPointees(FunctionModRefBehavior MRB) {
340     return !(MRB & FMRL_Anywhere & ~FMRL_ArgumentPointees);
341   }
342
343   /// Checks if functions with the specified behavior are known to potentially
344   /// read or write from objects pointed to be their pointer-typed arguments
345   /// (with arbitrary offsets).
346   static bool doesAccessArgPointees(FunctionModRefBehavior MRB) {
347     return (MRB & MRI_ModRef) && (MRB & FMRL_ArgumentPointees);
348   }
349
350   /// getModRefInfo (for call sites) - Return information about whether
351   /// a particular call site modifies or reads the specified memory location.
352   virtual ModRefInfo getModRefInfo(ImmutableCallSite CS,
353                                    const MemoryLocation &Loc);
354
355   /// getModRefInfo (for call sites) - A convenience wrapper.
356   ModRefInfo getModRefInfo(ImmutableCallSite CS, const Value *P,
357                            uint64_t Size) {
358     return getModRefInfo(CS, MemoryLocation(P, Size));
359   }
360
361   /// getModRefInfo (for calls) - Return information about whether
362   /// a particular call modifies or reads the specified memory location.
363   ModRefInfo getModRefInfo(const CallInst *C, const MemoryLocation &Loc) {
364     return getModRefInfo(ImmutableCallSite(C), Loc);
365   }
366
367   /// getModRefInfo (for calls) - A convenience wrapper.
368   ModRefInfo getModRefInfo(const CallInst *C, const Value *P, uint64_t Size) {
369     return getModRefInfo(C, MemoryLocation(P, Size));
370   }
371
372   /// getModRefInfo (for invokes) - Return information about whether
373   /// a particular invoke modifies or reads the specified memory location.
374   ModRefInfo getModRefInfo(const InvokeInst *I, const MemoryLocation &Loc) {
375     return getModRefInfo(ImmutableCallSite(I), Loc);
376   }
377
378   /// getModRefInfo (for invokes) - A convenience wrapper.
379   ModRefInfo getModRefInfo(const InvokeInst *I, const Value *P, uint64_t Size) {
380     return getModRefInfo(I, MemoryLocation(P, Size));
381   }
382
383   /// getModRefInfo (for loads) - Return information about whether
384   /// a particular load modifies or reads the specified memory location.
385   ModRefInfo getModRefInfo(const LoadInst *L, const MemoryLocation &Loc);
386
387   /// getModRefInfo (for loads) - A convenience wrapper.
388   ModRefInfo getModRefInfo(const LoadInst *L, const Value *P, uint64_t Size) {
389     return getModRefInfo(L, MemoryLocation(P, Size));
390   }
391
392   /// getModRefInfo (for stores) - Return information about whether
393   /// a particular store modifies or reads the specified memory location.
394   ModRefInfo getModRefInfo(const StoreInst *S, const MemoryLocation &Loc);
395
396   /// getModRefInfo (for stores) - A convenience wrapper.
397   ModRefInfo getModRefInfo(const StoreInst *S, const Value *P, uint64_t Size) {
398     return getModRefInfo(S, MemoryLocation(P, Size));
399   }
400
401   /// getModRefInfo (for fences) - Return information about whether
402   /// a particular store modifies or reads the specified memory location.
403   ModRefInfo getModRefInfo(const FenceInst *S, const MemoryLocation &Loc) {
404     // Conservatively correct.  (We could possibly be a bit smarter if
405     // Loc is a alloca that doesn't escape.)
406     return MRI_ModRef;
407   }
408
409   /// getModRefInfo (for fences) - A convenience wrapper.
410   ModRefInfo getModRefInfo(const FenceInst *S, const Value *P, uint64_t Size) {
411     return getModRefInfo(S, MemoryLocation(P, Size));
412   }
413
414   /// getModRefInfo (for cmpxchges) - Return information about whether
415   /// a particular cmpxchg modifies or reads the specified memory location.
416   ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX,
417                            const MemoryLocation &Loc);
418
419   /// getModRefInfo (for cmpxchges) - A convenience wrapper.
420   ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX, const Value *P,
421                            unsigned Size) {
422     return getModRefInfo(CX, MemoryLocation(P, Size));
423   }
424
425   /// getModRefInfo (for atomicrmws) - Return information about whether
426   /// a particular atomicrmw modifies or reads the specified memory location.
427   ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const MemoryLocation &Loc);
428
429   /// getModRefInfo (for atomicrmws) - A convenience wrapper.
430   ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const Value *P,
431                            unsigned Size) {
432     return getModRefInfo(RMW, MemoryLocation(P, Size));
433   }
434
435   /// getModRefInfo (for va_args) - Return information about whether
436   /// a particular va_arg modifies or reads the specified memory location.
437   ModRefInfo getModRefInfo(const VAArgInst *I, const MemoryLocation &Loc);
438
439   /// getModRefInfo (for va_args) - A convenience wrapper.
440   ModRefInfo getModRefInfo(const VAArgInst *I, const Value *P, uint64_t Size) {
441     return getModRefInfo(I, MemoryLocation(P, Size));
442   }
443
444   /// Check whether or not an instruction may read or write memory (without
445   /// regard to a specific location).
446   ///
447   /// For function calls, this delegates to the alias-analysis specific
448   /// call-site mod-ref behavior queries. Otherwise it delegates to the generic
449   /// mod ref information query without a location.
450   ModRefInfo getModRefInfo(const Instruction *I) {
451     if (auto CS = ImmutableCallSite(I)) {
452       auto MRB = getModRefBehavior(CS);
453       if (MRB & MRI_ModRef)
454         return MRI_ModRef;
455       else if (MRB & MRI_Ref)
456         return MRI_Ref;
457       else if (MRB & MRI_Mod)
458         return MRI_Mod;
459       return MRI_NoModRef;
460     }
461
462     return getModRefInfo(I, MemoryLocation());
463   }
464
465   /// Check whether or not an instruction may read or write the specified
466   /// memory location.
467   ///
468   /// An instruction that doesn't read or write memory may be trivially LICM'd
469   /// for example.
470   ///
471   /// This primarily delegates to specific helpers above.
472   ModRefInfo getModRefInfo(const Instruction *I, const MemoryLocation &Loc) {
473     switch (I->getOpcode()) {
474     case Instruction::VAArg:  return getModRefInfo((const VAArgInst*)I, Loc);
475     case Instruction::Load:   return getModRefInfo((const LoadInst*)I,  Loc);
476     case Instruction::Store:  return getModRefInfo((const StoreInst*)I, Loc);
477     case Instruction::Fence:  return getModRefInfo((const FenceInst*)I, Loc);
478     case Instruction::AtomicCmpXchg:
479       return getModRefInfo((const AtomicCmpXchgInst*)I, Loc);
480     case Instruction::AtomicRMW:
481       return getModRefInfo((const AtomicRMWInst*)I, Loc);
482     case Instruction::Call:   return getModRefInfo((const CallInst*)I,  Loc);
483     case Instruction::Invoke: return getModRefInfo((const InvokeInst*)I,Loc);
484     default:
485       return MRI_NoModRef;
486     }
487   }
488
489   /// A convenience wrapper for constructing the memory location.
490   ModRefInfo getModRefInfo(const Instruction *I, const Value *P,
491                            uint64_t Size) {
492     return getModRefInfo(I, MemoryLocation(P, Size));
493   }
494
495   /// Return information about whether a call and an instruction may refer to
496   /// the same memory locations.
497   ModRefInfo getModRefInfo(Instruction *I, ImmutableCallSite Call);
498
499   /// Return information about whether two call sites may refer to the same set
500   /// of memory locations. See the AA documentation for details:
501   ///   http://llvm.org/docs/AliasAnalysis.html#ModRefInfo
502   virtual ModRefInfo getModRefInfo(ImmutableCallSite CS1,
503                                    ImmutableCallSite CS2);
504
505   /// \brief Return information about whether a particular call site modifies
506   /// or reads the specified memory location \p MemLoc before instruction \p I
507   /// in a BasicBlock. A ordered basic block \p OBB can be used to speed up
508   /// instruction ordering queries inside the BasicBlock containing \p I.
509   ModRefInfo callCapturesBefore(const Instruction *I,
510                                 const MemoryLocation &MemLoc, DominatorTree *DT,
511                                 OrderedBasicBlock *OBB = nullptr);
512
513   /// \brief A convenience wrapper to synthesize a memory location.
514   ModRefInfo callCapturesBefore(const Instruction *I, const Value *P,
515                                 uint64_t Size, DominatorTree *DT,
516                                 OrderedBasicBlock *OBB = nullptr) {
517     return callCapturesBefore(I, MemoryLocation(P, Size), DT, OBB);
518   }
519
520   /// @}
521   //===--------------------------------------------------------------------===//
522   /// \name Higher level methods for querying mod/ref information.
523   /// @{
524
525   /// Check if it is possible for execution of the specified basic block to
526   /// modify the location Loc.
527   bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc);
528
529   /// A convenience wrapper synthesizing a memory location.
530   bool canBasicBlockModify(const BasicBlock &BB, const Value *P,
531                            uint64_t Size) {
532     return canBasicBlockModify(BB, MemoryLocation(P, Size));
533   }
534
535   /// Check if it is possible for the execution of the specified instructions
536   /// to mod\ref (according to the mode) the location Loc.
537   ///
538   /// The instructions to consider are all of the instructions in the range of
539   /// [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
540   bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
541                                  const MemoryLocation &Loc,
542                                  const ModRefInfo Mode);
543
544   /// A convenience wrapper synthesizing a memory location.
545   bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
546                                  const Value *Ptr, uint64_t Size,
547                                  const ModRefInfo Mode) {
548     return canInstructionRangeModRef(I1, I2, MemoryLocation(Ptr, Size), Mode);
549   }
550 };
551
552 /// isNoAliasCall - Return true if this pointer is returned by a noalias
553 /// function.
554 bool isNoAliasCall(const Value *V);
555
556 /// isNoAliasArgument - Return true if this is an argument with the noalias
557 /// attribute.
558 bool isNoAliasArgument(const Value *V);
559
560 /// isIdentifiedObject - Return true if this pointer refers to a distinct and
561 /// identifiable object.  This returns true for:
562 ///    Global Variables and Functions (but not Global Aliases)
563 ///    Allocas
564 ///    ByVal and NoAlias Arguments
565 ///    NoAlias returns (e.g. calls to malloc)
566 ///
567 bool isIdentifiedObject(const Value *V);
568
569 /// isIdentifiedFunctionLocal - Return true if V is umabigously identified
570 /// at the function-level. Different IdentifiedFunctionLocals can't alias.
571 /// Further, an IdentifiedFunctionLocal can not alias with any function
572 /// arguments other than itself, which is not necessarily true for
573 /// IdentifiedObjects.
574 bool isIdentifiedFunctionLocal(const Value *V);
575
576 } // End llvm namespace
577
578 #endif