Files
clang-p2996/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
Nikita Popov 78f7ca0980 [InstCombine] Use KnownBits predicate helpers (#115874)
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.
2024-11-14 10:13:50 +01:00

330 KiB