<div dir="ltr">LGTM except for the test, it should be moved to test/Transforms/InstSimplify.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 5:08 AM, Jay Foad <span dir="ltr"><<a href="mailto:jay.foad@gmail.com" target="_blank">jay.foad@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>PR19711: Souper (<a href="https://github.com/google/souper/" target="_blank">https://github.com/google/souper/</a>) discovered that we don't simplify this comparison to false:</div>
<div><br></div><div><div>  %mul = mul nsw i32 %0, -2</div>
<div>  %cmp = icmp eq i32 %mul, 1</div></div><div><br></div><div>Fix this by calling computeKnownBits to see if any bits are known to be 0 in one operand and 1 in the other, in which case the operands can't be equal.</div>

<div><br></div><div>I was a bit surprised that before this patch, there were no calls from InstructionSimplify.cpp to computeKnownBits. Is this the right approach? OK to commit?</div><div><br></div><div>The tweak to align-2d-gep.ll just avoids an unintended simplification, where we could prove that %indvar.next was always even so could never equal 557.<br>

</div><div><br></div><div>Thanks,</div>Jay.</div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">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/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>