From cf10b736fb9222773467c54c322c6af99d2fd6a5 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Wed, 9 Aug 2017 17:02:18 +0000 Subject: [PATCH] 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310495 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/CFLSteensAliasAnalysis.h | 2 +- lib/Analysis/CFLAndersAliasAnalysis.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/Analysis/CFLSteensAliasAnalysis.h b/include/llvm/Analysis/CFLSteensAliasAnalysis.h index fd3fa5febcd..03ce85aa97b 100644 --- a/include/llvm/Analysis/CFLSteensAliasAnalysis.h +++ b/include/llvm/Analysis/CFLSteensAliasAnalysis.h @@ -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. diff --git a/lib/Analysis/CFLAndersAliasAnalysis.cpp b/lib/Analysis/CFLAndersAliasAnalysis.cpp index 0de7ad98af4..1a3998836cf 100644 --- a/lib/Analysis/CFLAndersAliasAnalysis.cpp +++ b/lib/Analysis/CFLAndersAliasAnalysis.cpp @@ -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. -- 2.50.1