Global Aliases are not identifiable objects.
authorDan Gohman <gohman@apple.com>
Thu, 27 Aug 2009 17:52:56 +0000 (17:52 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 27 Aug 2009 17:52:56 +0000 (17:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80263 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasAnalysis.h
lib/Analysis/AliasAnalysis.cpp

index 54006aea0e21c85656bf04f095d007dc8d105863..be7d5ee37b80f1b1b1ba3862a013e38aecbf56f7 100644 (file)
@@ -347,7 +347,7 @@ bool isNoAliasCall(const Value *V);
 
 /// isIdentifiedObject - Return true if this pointer refers to a distinct and
 /// identifiable object.  This returns true for:
-///    Global Variables and Functions
+///    Global Variables and Functions (but not Global Aliases)
 ///    Allocas and Mallocs
 ///    ByVal and NoAlias Arguments
 ///    NoAlias returns
index 1d2efc1eda04115152e29d7805da27d11b5d416a..c456990d8ae2ce58aa4635f2a179e690ba073709 100644 (file)
@@ -233,13 +233,15 @@ bool llvm::isNoAliasCall(const Value *V) {
 
 /// isIdentifiedObject - Return true if this pointer refers to a distinct and
 /// identifiable object.  This returns true for:
-///    Global Variables and Functions
+///    Global Variables and Functions (but not Global Aliases)
 ///    Allocas and Mallocs
 ///    ByVal and NoAlias Arguments
 ///    NoAlias returns
 ///
 bool llvm::isIdentifiedObject(const Value *V) {
-  if (isa<GlobalValue>(V) || isa<AllocationInst>(V) || isNoAliasCall(V))
+  if (isa<AllocationInst>(V) || isNoAliasCall(V))
+    return true;
+  if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V))
     return true;
   if (const Argument *A = dyn_cast<Argument>(V))
     return A->hasNoAliasAttr() || A->hasByValAttr();