<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 27, 2017, at 9:39 AM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" class="">dberlin@dberlin.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 27, 2017 at 9:29 AM, Adam Nemet <span dir="ltr" class=""><<a href="mailto:anemet@apple.com" target="_blank" class="">anemet@apple.com</a>></span> wrote:<br class=""><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" class=""><br class=""><div class=""><span class="gmail-"><blockquote type="cite" class=""><div class="">On Feb 27, 2017, at 7:27 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>> wrote:</div><br class="gmail-m_8239107560126363242Apple-interchange-newline"><div class=""><div class="gmail-m_8239107560126363242moz-cite-prefix" style="font-family:helvetica;font-size:10px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br class="gmail-m_8239107560126363242Apple-interchange-newline">On 02/27/2017 06:29 AM, Nema, Ashutosh wrote:<br class=""></div><blockquote type="cite" style="font-family:helvetica;font-size:10px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" class=""><div class="gmail-m_8239107560126363242WordSection1"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class="">Thanks for looking into this.<u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class=""><u class=""></u> <u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class="">1) Issues with re running vectorizer:<u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class="">Vectorizer might generate redundant alias checks while vectorizing epilog loop.<u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class="">Redundant alias checks are expensive, we like to reuse the results of already computed alias checks.<u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class="">With metadata we can limit the width of epilog loop, but not sure about reusing alias check result.<u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif" class="">Any thoughts on rerunning vectorizer with reusing the alias check result ?</div></div></blockquote><br style="font-family:helvetica;font-size:10px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" class=""><span style="font-family:helvetica;font-size:10px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline" class="">One way of looking at this is: Reusing the alias-check result is really just a conditional propagation problem; if we don't already have an optimization that can combine these after the fact, then we should.</span><br style="font-family:helvetica;font-size:10px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" class=""></div></blockquote><div class=""><br class=""></div></span><div class="">+Danny</div><div class=""><br class=""></div><div class="">Isn’t Extended SSA supposed to help with this?</div></div></div></blockquote><div class=""><br class=""></div><div class="">Yes, it will solve this with no issue already.  GVN probably does already too.</div><div class=""><br class=""></div><div class="">even if if you have</div><div class=""><br class=""></div><div class="">if (a == b)</div><div class=""><div class="">if (a == c)</div></div><div class=""><div class=""> if (a == d)</div></div><div class=""><div class=""> if (a == e)</div></div><div class=""><div class=""> if (a == g)</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">and  we can prove a ... g equivalent, newgvn will eliminate them all and set all the branches true.</div><div class=""><br class=""></div><div class="">If you need a simpler clean up pass, we could run it on sub-graphs.</div></div></div></div></div></blockquote><div><br class=""></div><div>Yes we probably don’t want to run a full GVN after the “loop-scheduling” passes.</div><div><br class=""></div><div>I guess the pipeline to experiment with for now is opt -loop-vectorize -loop-vectorize -newgvn.</div><div><br class=""></div><div>Adam</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">The only thing you'd have to do is write some code to set "live on entry" subgraph variables in their own congruence classes.</div><div class="">We already do this for incoming arguments.</div><div class=""><br class=""></div><div class="">Otherwise, it's trivial to make it only walk things in the subgraph.</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div>
</div></blockquote></div><br class=""></body></html>