<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class=""><blockquote type="cite"><br>
    </blockquote></span>
    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.<br>
    <br>
    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 :)</div></blockquote><div> </div><div>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.<br></div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>As that changes, i expect the AA API will be redesigned and reworked to accomodate the needs of those things.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class="HOEnZb"><font color="#888888">
    - Jia<br>
  </font></span></div>

</blockquote></div><br></div></div>