[InstCombine] limit zext-of-icmp folds to bit-hacks
authorSanjay Patel <spatel@rotateright.com>
Mon, 9 Jan 2023 21:29:24 +0000 (16:29 -0500)
committerSanjay Patel <spatel@rotateright.com>
Mon, 9 Jan 2023 21:29:24 +0000 (16:29 -0500)
commitf400daae902875b488c92b13322e39f41eb20934
tree3f9ba8b0c4427a8363323ecd151fcc8bac4a3a18
parenta4f3b236719529bdc987d4f347e8711c27587ce4
[InstCombine] limit zext-of-icmp folds to bit-hacks

In the changed tests, we avoid creating extra instructions,
and there are no obvious regressions in IR tests at least.

Codegen should be able to create the shift+mask form if that
is profitable.

This is a more general fix for issue #59897 than 0eedc9e56712 .
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/zext.ll