[InstCombine] try to canonicalize icmp with trunc op into mask and cmp
authorSanjay Patel <spatel@rotateright.com>
Tue, 26 Oct 2021 21:41:19 +0000 (17:41 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 26 Oct 2021 21:43:28 +0000 (17:43 -0400)
commitacabad9ff6bf13e00305d9d8621ee8eafc1f8b08
treeefc064c5a21fa0faed866aa7ce62d1cf20457f74
parente8fdd030b1c3b971286b2353f2514b3cabb3fe5a
[InstCombine] try to canonicalize icmp with trunc op into mask and cmp

The motivating test is based on:
https://llvm.org/PR52260

We have better analysis for X == 0, so try harder to form that.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-trunc.ll
llvm/test/Transforms/InstCombine/signed-truncation-check.ll