BasicAA Tests

[+llvmdev]

Hi George,

You're right, these tests are broken, and have been for a long time. As it turns out, at least in terms of the 2003-12-11-ConstExprGEP.ll test, this is related to a case we've been discussing in another thread ("Basic AliasAnalysis: Can GEPs with the same base but different constant indices into a struct alias?"). It seems like, to some extent, we used to have this capability and lost it.

Ahmed, I think you might want to look into this.

-Hal

From: "Hal Finkel" <hfinkel@anl.gov>
To: "George Burgess IV" <george.burgess.iv@gmail.com>
Cc: "LLVM Developers Mailing List" <llvmdev@cs.uiuc.edu>
Sent: Wednesday, February 4, 2015 12:37:14 PM
Subject: Re: [LLVMdev] BasicAA Tests

[+llvmdev]

Hi George,

Also, can you please file a bug report to track these?

-Hal

http://llvm.org/bugs/show_bug.cgi?id=22462

George

[+llvmdev]

Hi George,

You're right, these tests are broken, and have been for a long time. As it turns out, at least in terms of the 2003-12-11-ConstExprGEP.ll test, this is related to a case we've been discussing in another thread ("Basic AliasAnalysis: Can GEPs with the same base but different constant indices into a struct alias?"). It seems like, to some extent, we used to have this capability and lost it.

Ahmed, I think you might want to look into this.

Ah, very nice! I'll have a harder look when I get back to working on
the BasicAA struct improvement. At a glance, they both seem to be
related, as you say.

In the meantime I'm fine with adding FIXMEs and changing all the tests.

-Ahmed

So it turns out BasicAA doesn't give a useful result for these tests
simply because datalayouts are missing from a bunch of them. Adding
it enables BasicAA to be more precise for the two tests mentioned, but
also turns MayAlias to PartialAlias in other tests (because IIRC
that's the fallback for GEPs, see the last few lines of aliasGEP).

I vaguely remember a change that made opt not use the host datalayout
anymore, which I guess is why these regressed at some point.

-Ahmed