<div dir="ltr"><div style>InstCombine was pattern matching for (icmp (shl 1, X), Cst) to try to transform these icmps to true/false if we could prove that Cst must be in/out of range.<br></div><div style><br></div><div style>
However, there are two problems:</div><div style>1. This sort of thing belongs in InstSimplify</div><div style>2. This can be generalized further</div><div style><br></div><div style>Attached is a patch that moves over these transforms to InstructionSimplify and handles arbitrary constants on the left hand side of the shift and constrains the possible range further by analyzing the nsw/nuw flags on the shift.</div>
</div>