]> granicus.if.org Git - llvm/commitdiff
CFLAA: return MustAlias when pointers p, q are equal, i.e.,
authorNuno Lopes <nunoplopes@sapo.pt>
Wed, 9 Aug 2017 17:02:18 +0000 (17:02 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Wed, 9 Aug 2017 17:02:18 +0000 (17:02 +0000)
must-alias(p, sz_p, p, sz_q)  irrespective of access sizes sz_p, sz_q

As discussed a couple of weeks ago on the ML.
This makes the behavior consistent with that of BasicAA.
AA clients already check the obj size themselves and may not require the
obj size to match exactly the access size (e.g., in case of store forwarding)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310495 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/CFLSteensAliasAnalysis.h
lib/Analysis/CFLAndersAliasAnalysis.cpp

index fd3fa5febcdfb3add66abd1f255fc2749fe635cd..03ce85aa97ba6da43979981612036bef4f60184a 100644 (file)
@@ -68,7 +68,7 @@ public:
 
   AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
     if (LocA.Ptr == LocB.Ptr)
-      return LocA.Size == LocB.Size ? MustAlias : PartialAlias;
+      return MustAlias;
 
     // Comparisons between global variables and other constants should be
     // handled by BasicAA.
index 0de7ad98af467480b2b5a156e5f99fdda5bd0d66..1a3998836cf37b2548cadbe3a3e11b5c5dad649a 100644 (file)
@@ -837,7 +837,7 @@ AliasResult CFLAndersAAResult::query(const MemoryLocation &LocA,
 AliasResult CFLAndersAAResult::alias(const MemoryLocation &LocA,
                                      const MemoryLocation &LocB) {
   if (LocA.Ptr == LocB.Ptr)
-    return LocA.Size == LocB.Size ? MustAlias : PartialAlias;
+    return MustAlias;
 
   // Comparisons between global variables and other constants should be
   // handled by BasicAA.