On Mon, Dec 5, 2011 at 11:01 PM, Dan Gohman <gohman at apple.com> wrote:> On Dec 5, 2011, at 6:04 PM, Daniel Berlin wrote: >> >> Yet, aa-eval still says otherwise. > > The problem is with aa-eval. It collects all the pointer values in a > function, and then just makes a bunch of raw pointer queries, rather than > considering dereferences. TBAA tags are only attached to dereferences. > So TBAA always has to say MayAlias for every aa-eval query.Makes sense. In that case, it would give the expected answers if clang was enhanced to properly deal with similar/dissimilar pointer types, instead of giving all pointer types the "everything" tag :) This requires implementing the "pointer to first member is allowed as pointer to struct"/etc rules, however.
On Dec 5, 2011, at 9:32 PM, Daniel Berlin wrote:> On Mon, Dec 5, 2011 at 11:01 PM, Dan Gohman <gohman at apple.com> wrote: >> On Dec 5, 2011, at 6:04 PM, Daniel Berlin wrote: >>> >>> Yet, aa-eval still says otherwise. >> >> The problem is with aa-eval. It collects all the pointer values in a >> function, and then just makes a bunch of raw pointer queries, rather than >> considering dereferences. TBAA tags are only attached to dereferences. >> So TBAA always has to say MayAlias for every aa-eval query. > > Makes sense. In that case, it would give the expected answers if > clang was enhanced to properly deal with similar/dissimilar pointer > types, instead of giving all pointer types the "everything" tag :)No, you've confused pointer types with pointee types. That "any pointer" tag is for describing when the in-memory objects themselves have pointer types. The real issue here is that -aa-eval is just a limited debugging tool that tends to get misinterpreted as a general-purpose AA benchmark due to there being no easy alternatives. Dan
On Tue, Dec 6, 2011 at 12:26 PM, Dan Gohman <gohman at apple.com> wrote:> > On Dec 5, 2011, at 9:32 PM, Daniel Berlin wrote: > >> On Mon, Dec 5, 2011 at 11:01 PM, Dan Gohman <gohman at apple.com> wrote: >>> On Dec 5, 2011, at 6:04 PM, Daniel Berlin wrote: >>>> >>>> Yet, aa-eval still says otherwise. >>> >>> The problem is with aa-eval. It collects all the pointer values in a >>> function, and then just makes a bunch of raw pointer queries, rather than >>> considering dereferences. TBAA tags are only attached to dereferences. >>> So TBAA always has to say MayAlias for every aa-eval query. >> >> Makes sense. In that case, it would give the expected answers if >> clang was enhanced to properly deal with similar/dissimilar pointer >> types, instead of giving all pointer types the "everything" tag :) > > No, you've confused pointer types with pointee types. That "any pointer" > tag is for describing when the in-memory objects themselves have pointer > types.Right, and when i later debugged it, some of the queries were about whether int** could alias a float *, which would properly be fixed ...
Dan, Thanks for clarifying. This makes perfect sense. Gan>> Makes sense. In that case, it would give the expected answers if >> clang was enhanced to properly deal with similar/dissimilar pointer >> types, instead of giving all pointer types the "everything" tag :) > > No, you've confused pointer types with pointee types. That "any pointer" > tag is for describing when the in-memory objects themselves have pointer > types.