<div dir="ltr"><div class="gmail_quote">Minor aside -- not sure it really is that relevant to this specific concern:</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Apr 8, 2015 at 1:47 PM Jingyue Wu <<a href="mailto:jingyue@google.com">jingyue@google.com</a>> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="line-height:1.5;font-size:13.1999998092651px">2. -reassociate happens too early. Many opportunities I discovered are exposed after loop unrolling, but -reassociate happens before loop unrolling. </span></div></div></blockquote><div><br></div><div>I think this is a bug. We should absolutely be running this pass (and potentially others) after loop unrolling.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="line-height:1.5;font-size:13.1999998092651px"><br></span></div><div><span style="font-size:13.1999998092651px;line-height:1.5">Jingyue </span><br></div></div><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 1:23 PM Sanjoy Das <<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Should this rule live inside `-reassociate`?  Optimizing<br>
<br>
   define void @reassociate(i32 %a, i32 %b, i32 %c) {<br>
    %1 = add i32 %a, %c<br>
    call void @foo(i32 %1)<br>
    %2 = add i32 %a, %b<br>
    %3 = add i32 %2, %c<br>
    call void @foo(i32 %3)<br>
    ret void<br>
  }<br>
<br>
to<br>
<br>
   define void @reassociate(i32 %a, i32 %b, i32 %c) {<br>
    %1 = add i32 %a, %c<br>
    call void @foo(i32 %1)<br>
    %3 = add i32 %1, %b<br>
    call void @foo(i32 %3)<br>
    ret void<br>
  }<br>
<br>
looks like a generally good idea to me.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D8898" target="_blank">http://reviews.llvm.org/D8898</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/<u></u>settings/panel/<u></u>emailpreferences/</a><br>
<br>
<br>
</blockquote></div>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>