4 ms·
Compilers already reason about values like that. They can prove certain bits in an integer to have certain values, etc, not just about ranges. Actual checks cou
by vardump 10y ago
Compilers already reason about values like that. They can prove certain bits in an integer to have certain values, etc, not just about ranges. Actual checks could be optimized away pretty often.
Simple example: Say, you multiply a number by two. From that, the compiler data flow analysis knows the lowest bit can only be zero. So it can safely optimize away anything that checks that bit.