<div dir="ltr">We fail to convert a urem to an and if we have a select between two powers of two.<div style>The reason why is because it gets turned into (add (and (lshr V, C1), C2), C2) and we can not tell that it is a power of two any more.</div>
<div style><br></div><div style>The most natural thing seems to be to teach isKnownToBeAPowerOfTwo that (X & Y) + Y is a power of two or zero if Y is a power of two.</div><div style><br></div><div style>A patch is attached with a test case.</div>
<div style><br></div><div style>-- </div><div style>David Majnemer</div></div>