<div dir="ltr">Yeah, the way that we do it now could probably be less hacky. If you want to add a better way of saying "please add this thing to the graph, but don't actually link it to anything", you're welcome to. If you do, it should probably also support "please add these attributes to this thing," since that's another big reason we use circular edges. :)<div><div><br></div><div>Also, given that this discussion seems to be not about the patch, and that the patch LGTM, I'll submit it.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 1, 2016 at 11:11 AM, Jia Chen <span dir="ltr"><<a href="mailto:grievejia@gmail.com" target="_blank">grievejia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Wed, Jun 1, 2016 at 12:38 PM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>> wrote:<br>
> Sure, and FWIW, it depends on the definition of unused.<br>
> GCC's andersen's analysis eliminates variables (ie prior to solving) that<br>
> are not treated like pointers.<br>
> That is, if they are not dereferenced, etc, it simply ignores them.  You can<br>
> prove this is correct, and is common (see<br>
> <a href="https://www.lib.utexas.edu/etd/d/2009/hardekopfb48332/hardekopfb48332.pdf" rel="noreferrer" target="_blank">https://www.lib.utexas.edu/etd/d/2009/hardekopfb48332/hardekopfb48332.pdf</a><br>
> and <a href="http://aria.cs.vt.edu/refs/docs/pldi00.ps" rel="noreferrer" target="_blank">http://aria.cs.vt.edu/refs/docs/pldi00.ps</a> for non-pointer elimination)<br>
<br>
</span>I agree that it is possible. However, the current cfl-aa<br>
implementation is not doing something that gcc does (it is even less<br>
precise than Andersen's analysis at this point!). It just looks at<br>
instructions, translates them to edges, and add edges to<br>
StratifiedSets. What bothers me here is why we must explicitly add<br>
assign edges for things like unused allocas, e.g. malloc() return<br>
values, and free() argument. In other words, the suspicion is on the<br>
implementation, not the underlying approach.<br>
</blockquote></div><br></div></div>