Nuno Lopes via llvm-dev
2017-Jul-14 19:50 UTC
[llvm-dev] PartialAlias: different start addresses
Hi, I going through the alias analysis documentation (http://llvm.org/docs/AliasAnalysis.html) and noticed the following in the definition of PartialAlias: " The PartialAlias response is used when the two memory objects are known to be overlapping in some way, but *do not start at the same address*. " Is it really required that the objects do no start at the same address? if that's the case the AA algorithm would need to prove that. I'm asking this because: 1) This condition seems very strict and I don't think it's met in a few places I found by manual inspection 2) I couldn't find any client that uses this information in a meaningful way. Is there a use case for PartialAlias w/ strict distinct starting addresses? Thanks, Nuno
Davide Italiano via llvm-dev
2017-Jul-14 20:00 UTC
[llvm-dev] PartialAlias: different start addresses
On Fri, Jul 14, 2017 at 12:50 PM, Nuno Lopes via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hi, > > I going through the alias analysis documentation > (http://llvm.org/docs/AliasAnalysis.html) and noticed the following in the > definition of PartialAlias: > " > The PartialAlias response is used when the two memory objects are known to > be overlapping in some way, but *do not start at the same address*. > " > > Is it really required that the objects do no start at the same address? if > that's the case the AA algorithm would need to prove that. > I'm asking this because: > 1) This condition seems very strict and I don't think it's met in a few > places I found by manual inspectionIf I read the definition correctly, at least our Andersens' AA implementation violates it. see: AliasResult CFLAndersAAResult::alias(const MemoryLocation &LocA, const MemoryLocation &LocB) { if (LocA.Ptr == LocB.Ptr) return LocA.Size == LocB.Size ? MustAlias : PartialAlias; (i.e. the two objects are overlapping here *and* start at the same address).
Hal Finkel via llvm-dev
2017-Jul-14 20:06 UTC
[llvm-dev] PartialAlias: different start addresses
On 07/14/2017 03:00 PM, Davide Italiano via llvm-dev wrote:> On Fri, Jul 14, 2017 at 12:50 PM, Nuno Lopes via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Hi, >> >> I going through the alias analysis documentation >> (http://llvm.org/docs/AliasAnalysis.html) and noticed the following in the >> definition of PartialAlias: >> " >> The PartialAlias response is used when the two memory objects are known to >> be overlapping in some way, but *do not start at the same address*. >> " >> >> Is it really required that the objects do no start at the same address? if >> that's the case the AA algorithm would need to prove that. >> I'm asking this because: >> 1) This condition seems very strict and I don't think it's met in a few >> places I found by manual inspection > If I read the definition correctly, at least our Andersens' AA > implementation violates it. > see: > > AliasResult CFLAndersAAResult::alias(const MemoryLocation &LocA, > const MemoryLocation &LocB) { > if (LocA.Ptr == LocB.Ptr) > return LocA.Size == LocB.Size ? MustAlias : PartialAlias; > > > (i.e. the two objects are overlapping here *and* start at the same address).I've never noticed that part of the definition myself. I'm fairly certain that's not what we actually implement. -Hal> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory