[llvm-dev] Existing studies on the benefits of pointer analysis

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 28 08:26:30 PDT 2016


>
>
> For the example to work here the CSE pass itself needs to be
> flow-sensitive and context-sensitive. I don't think that's how most
> optimizations in LLVM work. If it is, then I agree with all you said. But
> if it isn't, there's no point in bumping up the context sensitivity just
> for the pointer analysis.
>
> As Daniel mentioned earlier in this thread, the analysis analysis
> framework in LLVM doesn't provide any APIs for flow-sensitive queries as
> well as context-sensitive queries. This design choice almost eliminate any
> possibilities for a flow-sensitive or context-sensitive pointer analysis to
> be useful. Strangely, the set of APIs does support 1-CFA context-sensitive
> mod-ref queries (so I guess one could somehow reap some context-sensitive
> benefits out of them after all). To me that design incoherence looks
> confusing, but I'm pretty sure you know much better than me why it should
> work that way :)
>

In general, I would never assume someone sat down and thought *really hard*
about the design of an API in a piece of software to get it right for all
time. It happens, but it's actually pretty rare.  One of the most limited
resources most software teams have is time, and they use often use that
time to get done what they need, and design APIs based on current and
easily predictable future needs.

The same thing is true about LLVM's APIs.  You shouldn't assume we sat
down, thought really hard about AA by meditating upon a mountain, and then
designed this API.  Instead, some thought was put into it, based on current
and easily predicted needs, and then people moved on.

I can't say this was the wrong choice, either, given how long it has been
since someone has even come along considering implementing context
sensitive or flow-sensitive AA (and having talked to tons of people over
the years, this is *not* a chicken and egg problem. Literally nobody has
had a *strong* desire). It wouldn't make much sense to try to design an API
without any implementations that want to use those API's.

As that changes, i expect the AA API will be redesigned and reworked to
accomodate the needs of those things.

- Jia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160328/5c061b96/attachment.html>


More information about the llvm-dev mailing list