[llvm-dev] [PM] I think that the new PM needs to learn about inter-analysis dependencies...

Chandler Carruth via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 13 01:05:26 PDT 2016


On Wed, Jul 13, 2016 at 12:39 AM Hal Finkel <hfinkel at anl.gov> wrote:

> Interesting. I'm not sure this is the right metric, however. There are
> lots of analyses that hold pointers to other analyses but don't need to.
> The analysis handle itself can be reacquired lazily if we care to do so.
> What's truly problematic is holding pointers into another analysis's data
> structures. To be concrete, holding a pointer to ScalarEvolution is not a
> fundamental problem because we could make the analysis reacquire the
> pointer at the start of every query. Holding SCEV* is the problem.
>

Agreed. I suspect this is the dominant pattern.

FWIW, I still think this is common enough to design a solution that makes
> it easy to get this right.
>

I somewhat suspect that it would be better to pass these in along the query
path rather than have results cache them. The reason is that if the user of
the analysis is aware of the other analyses it depends on, it will also be
aware of that cost and the reality of potentially wanting to preserve them.

I'd be interested in us spending some time trying to make this refactoring
and at least understanding how hard it is before we engineer a solution
that makes the analysis management more complex.

So as you seemed to agree in your other email (sorry for the heavily
branching thread) perhaps we should start with the potentially error prone
approach now, and see how much iteration can move toward "nothing to do" by
lifting things into the query path rather than the result object.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160713/92cd4d73/attachment.html>


More information about the llvm-dev mailing list