[PATCH] D20776: [CFLAA] Teach cfl-aa to understand heap memory allocation

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 10:38:00 PDT 2016


On Wed, Jun 1, 2016 at 9:39 AM, Jia Chen <grievejia at gmail.com> wrote:

> On Mon, May 30, 2016 at 6:49 PM, Daniel Berlin <dberlin at dberlin.org>
> wrote:
> > Sure it is. It is safe to give conservatively correct answers,  even if
> you
> > don't incrementally recompute.
>
> You are right. I take back what I said before. That was a strong and
> blind statement.
>
> > What transformation do you think can occur that would make the points-to
> set
> > not conservatively correct, but retain the semantics of the original
> > program?
>
> I can't find anything on top of my head. Maybe there doesn't exist any.
>



> I'm not convinced that such kind of transformation must not be
> presented or will not be presented in the future.


You can prove it if you like (it also depends on your definition of
semantics).

However, i will point out that GCC recomputes points-to sets twice, and
then only for precision, not for correctness.



> But for now, I agree
> that values not presented in StratifiedSets should be treated
> conservatively.
>
> I do feel suspicious about the fact that unused values are not added
> to StratifiedSets in the first place. But with respect to this patch,
> that's probably a tangential topic.
>

Sure, and FWIW, it depends on the definition of unused.
GCC's andersen's analysis eliminates variables (ie prior to solving) that
are not treated like pointers.
That is, if they are not dereferenced, etc, it simply ignores them.  You
can prove this is correct, and is common (see
https://www.lib.utexas.edu/etd/d/2009/hardekopfb48332/hardekopfb48332.pdf
and http://aria.cs.vt.edu/refs/docs/pldi00.ps for non-pointer elimination)

If unused means "unreachable", that's a different issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160601/62f4399d/attachment.html>


More information about the llvm-commits mailing list