CFLAA: return MustAlias when pointers p, q are equal, i.e.,

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)

llvm-svn: 310495
This commit is contained in:
Nuno Lopes 2017-08-09 17:02:18 +00:00
parent cd3b9fedc7
commit 7829506731
2 changed files with 2 additions and 2 deletions

View 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.

View 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.