[llvm-commits] [llvm] r113858 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/LibCallAliasAnalysis.h include/llvm/Analysis/LibCallSemantics.h include/llvm/LLVMContext.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/AliasAnalysisCounter.cpp lib/Analysis/AliasDebugger.cpp lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/IPA/GlobalsModRef.cpp lib/Analysis/LibCallAliasAnalysis.cpp lib/Analysis/ScalarEvolutionAliasAnalysis.cpp lib/Analysis/TypeBasedAliasAnalysis.cpp lib/VMCore/LLVMContext.cpp

Chris Lattner clattner at apple.com
Wed Sep 15 18:24:04 PDT 2010


On Sep 14, 2010, at 2:25 PM, Dan Gohman wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=113858&view=rev
> Log:
> Remove the experimental AliasAnalysis::getDependency interface, which
> isn't a good level of abstraction for memdep. Instead, generalize
> AliasAnalysis::alias and related interfaces with a new Location
> class for describing a memory location. For now, this is the same
> Pointer and Size as before, plus an additional field for a TBAA tag.

Great!

> +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Sep 14 16:25:10 2010
> @@ -83,6 +83,22 @@
>   /// Alias Queries...
>   ///
> 
> +  /// Location - A description of a memory location.
> +  struct Location {
> +    /// Ptr - The address of the start of the location.
> +    const Value *Ptr;
> +    /// Size - The size of the location.
> +    unsigned Size;
> +    /// TBAATag - The metadata node which describes the TBAA type of
> +    /// the location, or null if there is no (unique) tag.
> +    const MDNode *TBAATag;
> +
> +    explicit Location(const Value *P = 0,

Should the pointer be allowed to be null?  Is Location() something that is useful?


> +  /// pointsToConstantMemory - If the specified memory location is known to be
> +  /// constant, return true.  This allows disambiguation of store
>   /// instructions from constant pointers.
>   ///
> +  virtual bool pointsToConstantMemory(const Location &Loc);

Interesting.  I agree with the change, but I'll have to think about what this can be used for.

-Chris





More information about the llvm-commits mailing list