<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 8, 2018, at 9:50 AM, Daniel Berlin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">1.  The reassociate pass that exists right now was *originally* (AFAIK) written to enable CSE/GVN to do better.</div></div></blockquote><div><br class=""></div><div>Agreed.  The original mindset included a (naive) belief that going with a canonical form was better than teaching redundancy elimination to handle abstractions (as a matter of separation of concerns).  I think that that was a failed experiment at this point :-).  We should still canonicalize x*x*x into powi, but the more aggressive canonicalization (like distribution) shouldn’t be used IMO.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""> That particular issue is solvable in other ways, because there are good ways to integrate reassociation into CSE/GVN (and at this point, it would probably be cheaper than -reassociate since it would modify code less, only changing it when there are actual redundancies )<div class=""><br class=""></div><div class=""><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial" class="">I don't know what other things people are trying to target with reassociate these days, it would be good to understand what others see as the use cases.</div><br class=""></div><div class="">My only other fear with removing it is that we have a tendency to try to make every optimization do everything, so i fear removing reassociate might just have people try to improve every pass to do reassociation instead of declaring what is good enough.</div><div class=""><br class=""></div><div class="">(For example, GVN already does some reassociation, as do some analysis. Other analysis relies more on a canonical form existing and don't, for example, try to perform commutativity on their own.  IMHO, we should just declare one or the other to be the case, and hold that line, rather than generate a mishmash)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">2. "<span style="font-size:12.8px" class="">Keep in mind that instcombine runs 1st, runs to fixed-point, and runs 8 times in the -O2 pipeline."</span></div><div class=""><br class=""></div><div class=""><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial" class=""><span style="font-size:12.8px" class="">Y'all know how i feel about this one, so i'll leave it alone :)</span></div><br class="gmail-Apple-interchange-newline"></div></div><br class=""><div class=""><br class=""></div><div class="">--Dan</div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>