AliasSetTracker

I started using the AliasSetTracker, but I have a problem.

I am using -basicaa -anders-aa and optimizations are enabled for llvm-gcc and llvm-ld.
I use an instruction visitor to populate the alias set tracker, but two pointers end up in different alias sets.
While investigating this I notice at one point that if I call:

bool New = false;
AliasSet &X = AST->getAliasSetForPointer(Pointer, Size, &New);

After this call, New is true
but AST->containsPointer(Pointer, Size) is false! Shouldn’t it be true at this point?

If I call again getAliasSetForPointer after resetting New, it remains false, as I expect it after the first call.

But AST->getAliasSetForPointerIfExists(Pointer, Size) returns null. Again, shouldn’t it return the same alias set as the first call?

Am I misunderstanding something? This seems to work without optimizations or without -anders-aa.

Using revision 79271

Best regards,
Marcus

I started using the AliasSetTracker, but I have a problem.

Hi Marcus,

At best, anders-aa is beta-quality. It probably has several bugs and is not really ready to be widely used.

-Chris

I started using the AliasSetTracker, but I have a problem.

Hi Marcus,

At best, anders-aa is beta-quality. It probably has several bugs and is not really ready to be widely used.

Thanks, I’ll keep that in mind.

One thing I notice is that pointers like
extern char *p;
extern char *q;
don’t alias with each other.

This seems to be a bug, as the code that loops over globals in Andersens does make these point to a universal set,
so their points-to should intersect.

Eventually I want all these externals to end up in the same AliasSet, and then I need a way to check which alias set includes the universal set.

Anyway, I copied Andersens into my project and will try to fix these.