Ping x2.<span></span><br><br>On Monday, June 17, 2013, David Majnemer  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ping.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Jun 9, 2013 at 8:15 PM, David Majnemer <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'david.majnemer@gmail.com');" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>On Sun, Jun 9, 2013 at 1:27 PM, David Majnemer <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'david.majnemer@gmail.com');" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br>

</div><div class="gmail_extra"><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>On Sun, Jun 9, 2013 at 10:37 AM, Duncan Sands <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'duncan.sands@gmail.com');" target="_blank">duncan.sands@gmail.com</a>></span> wrote:<br>


</div><div class="gmail_extra"><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<div><div><br>
<br>
On 09/06/13 14:10, David Majnemer wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We may, after other optimizations, find ourselves with IR that looks like:<br>
<br>
   %shl = shl i32 1, %y<br>
   %cmp = icmp ult i32 %shl, 32<br>
<br>
However, we should transform it to:<br>
<br>
   %cmp = icmp ult i32 %y, 5<br>
<br>
The attached patch teaches visitICmpInstWithInstAndIntCst how to perform this<br>
transform.<br>
</blockquote>
<br></div></div>
while the patch looks OK, I think it could be more general.  In your example,<br>
if the icmp ult was with, say, 30 then you still could have transformed it.<br>
In the case of an icmp eq comparison, if the RHS is not a power of two then<br>
it cannot be equal to the left hand side, so you could fold the comparison to<br>
false.<br></blockquote><div><br></div></div><div>Thanks! I've attached an updated patch that implements additional transforms.</div></div></div></div></blockquote><div><br></div></div><div>And yet more transforms, it turns out we turn some unsigned comparisons into signed comparisons. Optimize these too.</div>

<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 class="gmail_extra"><div class="gmail_quote"><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<br>
Ciao, Duncan.<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="javascript:_e({}, 'cvml', '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><br></div></div>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div>
</blockquote>