<div dir="ltr"><div>PR19711: Souper (<a href="https://github.com/google/souper/">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>