<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 15, 2017 at 6:32 AM, Peter Lawrence <span dir="ltr"><<a href="mailto:peterl95124@sbcglobal.net" target="_blank">peterl95124@sbcglobal.net</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 style="word-wrap:break-word"><div>Daniel,</div><div>           Thanks for taking the time to respond.</div><div><br></div></div></blockquote><div>This is going to be my last response.</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 style="word-wrap:break-word"><div></div><div>Regarding GVN and newGVN, I recently finished a search through the</div><div>llvm-dev archives for “nsw” in the subject line, and GVN was discussed in</div><div>some of those threads [1].</div><div><br></div><div>In particular it was claimed that there was a right choice for GVN to make given</div><div>two ADD instructions, one with the “nsw” attribute and one without, the one</div><div>without ‘nsw’ must be the representative.</div></div></blockquote><div><br></div><div><div>GVN does not choose representatives based on the kind of attributes you refer to because they are not properties of the value for the purposes of representation, nor do i see how it would ever make sense to do so.</div></div><div>GVN can always patch the instructions after the fact to make sure the set of attributes of the *operations* where the instructions occur is correct for where they came from.</div><div><br></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 style="word-wrap:break-word"><div><br></div><div>This was described as a correctness issue, not an optimality issue. IE if you</div><div>are going to CSE those two ADDs, it is safe to loose information (drop the ‘nsw’)</div><div>but it is unsafe to put ‘nsw’ on to an operation that didn’t already have it</div><div>because that is like inserting an “llvm.assume" where there was none.</div></div></blockquote><div><br></div><div>This is unrelated to the choice of representative, and related to ensuring that operations are modified for the properties of the representative chosen.</div><div>Anything else would avoid value numbering </div><div><br></div><div>"add a, b" and "add nsw a, b"</div><div><br></div><div>to the same thing, when at worst, i just may have to drop the NSW if i replace the second with the first</div><div><br></div><div><br></div></div></div></div>