> 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. > > Dan > >Hi Dan, So do you know how to get the correct results from tbaa? It seems "print-alias-sets" also has all the pointers in one set. Yi
On Mon, Dec 5, 2011 at 11:08 PM, <liyi at cs.toronto.edu> 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. >> >> Dan >> >> > > Hi Dan, > > So do you know how to get the correct results from tbaa? It seems > "print-alias-sets" also has all the pointers in one set.If you want it to say that float * and int * don't alias, you will have to enhance clang to generate TBAA tags for pointer types properly. It should already say that float * and int don't alias, and int * and float don't alias. You can see equivalent hand-written examples in test/Analysis/TypeBasedAliasAnalysis/
Hi Daniel,> If you want it to say that float * and int * don't alias, you will > have to enhance clang to generate TBAA tags for pointer types > properly. > It should already say that float * and int don't alias, and int * and > float don't alias.>From what you said above, do you mean that, the current clang can notdisambiguate a "float pointer" (float *) and an "int pointer" (int *)? Gan
On Dec 5, 2011, at 8:08 PM, liyi at cs.toronto.edu 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. >> >> Dan >> >> > > Hi Dan, > > So do you know how to get the correct results from tbaa? It seems > "print-alias-sets" also has all the pointers in one set.-print-alias-sets is going to be pretty useless, because any time there's even a single "omnipotent char" anywhere, it'll MayAlias everything, so everything will be transitively MayAliased to everything else, and you'll end up with one big set. I don't think there are any other tools that do anything similar in LLVM. Dan