News for hackers. Stuff that matters.
Re:Three Optimization Tips for C++ by kazagistar on Thursday May 08, 2014 @12:48PM (#7716239)
> when we know that an integer is a multiple of some constant

How is a compiler supposed to track that information? That requires some serious dependent typing.

Re:Three Optimization Tips for C++ by pbsd on Thursday May 08, 2014 @12:56PM (#7716285)
It's not (by itself, at least). But you can give it hints, as in my example above (with __builtin_unreachable; other compilers have similar facilities, like __assume in MSVC). The compiler should, in theory, be able to deduce that x % 113 is always 0, and therefore must be a multiple of 113.