<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 30, 2016 at 3:28 AM, Andrey Bokhanko <span dir="ltr"><<a href="mailto:andreybokhanko@gmail.com" target="_blank">andreybokhanko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Daniel,<div><br></div><div>OK, I see your point.</div><div><br></div><div>My understanding was that VNDAG is an internal representation, not meant to be used by VN's customers (that should really care for classes of congruency, nothing more).</div></div></blockquote><div><br></div><div>Depends on the customers?<br>You provide what your customers want, not decide what they want :)</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> Also, I thought that VN's results are available for a single function at a time. It seems that NewGVN provides access to VNDAGs computed for the whole program -- which enables its usage in Jessica's pass.</div></div></blockquote><div><br></div><div>It does not currently, this would be trivial to do, however.</div><div> <br></div><div><br></div><div>You are going very very far into the implementation details which very much do not matter from an algorithm design perspective.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Still, some issues remain. I wonder what leaf nodes for reads of "a" and "b" values contain? If they have VN numbers (as the "Efficient SSA" paper says) and VNDAG comparator compares them (for leafs), then the best one can do is this:</div><div><br></div><div><div>int outlined(int arg1, int arg2)</div><div>{</div><div>  return arg1 + arg2;</div><div>}</div><div><br></div><div>int foo() {</div><div>  arg1 = a;</div><div>  arg2 = b;</div><div>  return outlined(arg1, arg2);</div><div>}</div><div><br></div><div>int bar() {</div><div>  arg1 = a;</div><div>  arg2 = b;</div><div>  return outlined(arg1, arg2);</div><div>}</div></div><div><br></div><div>that hardly helps.</div><div><br></div></div></blockquote><div><br></div><div>See above. Again, you are going really far into implementation details for no reason i can see. We can do pretty much whatever we want.<br>Remember also, you outlined a single statement function, that is the best you can do in pretty much any legal case.</div><div><br></div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>If, on the other hand, VNDAG's comparator compares variable names and doesn't pick classes of congruency at all, how this relates to Value Numbering? SSA can be used for this purpose just as well.</div><div><br></div><div>I tend to agree with Hal -- value numbering computes equivalent *values*,</div></div></blockquote><div>Sorry, but this is just flat out wrong</div><div><br></div><div>"A Global Value Numbering(GVN) algorithm is considered to be complete (or precise), if it can detect all Herbrand equivalences among expressions in a program.</div><div>Two expressions are said to be Herbrand equivalent (or transparent equivalent ), if they are computed by the same operator applied to equivalent operands "</div><div><br></div><div>This is, AFAIK, precisely what you want.<br></div><div><br></div></div></div></div>