<div dir="ltr">The attached patch can transform:<div><br></div><div>(A & ~B) == 0 --> (A & B) != 0<br></div><div>(A & ~B) != 0 --> (A & B) == 0<br></div><div><br></div><div style>if we can prove that A is definitely a power of 2.</div>
<div style><br></div><div style>Last time I tried this (almost exactly four months ago), self hosted clang builds failed because of undefined behavior. Somewhere.</div><div style><br></div><div style>I've tested this patch against a checkout that was compiled by a compiler that was compiled with this patch and it went fine.</div>
<div style><br></div><div style>Tests that exercise both transforms are included.</div><div style><br></div><div style>-- </div><div style>David Majnemer</div></div>