[LLVMdev] question about enabling cfl-aa and collecting a57 numbers

Daniel Berlin dberlin at dberlin.org
Wed Jan 14 09:16:02 PST 2015


On Wed, Jan 14, 2015 at 7:49 AM, Daniel Berlin <dberlin at dberlin.org> wrote:

>
>
> On Tue, Jan 13, 2015 at 11:26 PM, Nick Lewycky <nlewycky at google.com>
> wrote:
>
>> On 13 January 2015 at 22:11, Daniel Berlin <dberlin at dberlin.org> wrote:
>>
>>> This is caused by CFLAA returning PartialAlias for a query that BasicAA
>>> can prove is NoAlias.
>>>
>>
>> One of them is wrong. Which one?
>>
>
>>
> CFL-AA.
>
> Right now it checks whether two things come out to be the same stratified
> info and have the same index, and if so, returns PartialAlias. This is
> wrong, because it never knows why two things got unified, only that they
> did.
>

Someone asked what I meant by this, so, two things:
First, CFL-AA does not know whether the statements it processes will ever
be executed or where they occur in the function.. The results also do not
depend on the order in which statements are processed.

So even if it only sees one assignment and nothing else, and unifies those
two variable, the result is no different whether the assignment is in a
branch or whether it is the only statement in the function.

IE

int *a;
int *b;

a = b

and

if (c)
  a = b


should produce the same pointer-analysis result with CFL-AA (and all flow +
path -insensitive analysis).

If these are the only pointer assigning statements in the function, the
first is must-alias, the second is may-alias.
Because it cannot distinguish these two, IMHO, it can never return
must-alias (or partialalias).

Second, the process of pointer info unification is not and should not be
related to the process of assignments in practice (and thus, even if you
could distinguish the above, the fact that it believes two pointers
equivalent does not make them must-alias).

Variables may get unified because we lack info and it's the conservatively
safe thing to do, or even because we are trying to lower the time bounds
and decide losing precision is okay.

In short, unless i'm missing something drastic, i can't see how CFL-AA can
ever produce must-alias or partial-alias info.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150114/ee060fa3/attachment.html>


More information about the llvm-dev mailing list