Inside foldICmpUsingKnownBits(), instead of rolling our own logic based on min/max values, make use of ICmpInst::compare() working on KnownBits. This gives better results for the equality predicates. In practice, the improvement is only for pointers, because isKnownNonEqual() handles the non-pointer case. I've adjusted some tests to prevent the new fold from triggering, to retain their original intent of testing constant expressions.
330 KiB
330 KiB