<div dir="ltr">Ping. Slightly improved patch attached.<div><br></div><div><br></div><div>It seems to me that InstCombine is still rather weak for</div><div><br></div><div>  icmp eq (or A, B), 0</div><div><br></div><div>... because, while it has a lot of tricks for combining</div>
<div><br></div><div>  icmp eq A, 0</div><div><br></div><div>... it doesn't try them in this case. I've made an attempt to fix that by converting icmp eq (or A, B), 0 -> and (icmp eq A,0) (icmp eq B, 0) if either of the subexpressions of the 'and' combine further. That change is not included in the attached patch because it's really ugly: InstCombine doesn't seem well-suited to a combine step producing more than one new instruction. Am I approaching this the wrong way?</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 6:55 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</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">Hi!<div><br></div><div>The attached patch teaches LLVM to fold together repeated tests for divisibility by a constant into a single test for divisibility by the LCM of the constants.</div>
<div><br></div><div>
This was inspired by PR20205 (but doesn't directly help there, because we can't compute a trip count for its loop, nor peel the loop like GCC does).</div></div>
</blockquote></div><br></div>