[InstCombine] foldICmpWithLowBitMaskedVal(): handle uncanonical ((-1 << y) >> y)...
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 19 Sep 2018 13:35:46 +0000 (13:35 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 19 Sep 2018 13:35:46 +0000 (13:35 +0000)
commitf50023d37c19eefc45ec15ce184cc7e057207d57
tree04d4f10781bd2f0884c731b9181fa6346391cda5
parentca2bdb03d6cfeef068dcae8ae3bf78ead219612a
[InstCombine] foldICmpWithLowBitMaskedVal(): handle uncanonical ((-1 << y) >> y) mask

Summary:
The last low-bit-mask-pattern-producing-pattern i can think of.

https://rise4fun.com/Alive/UGzE <- non-canonical
But we can not canonicalize it because of extra uses.

https://bugs.llvm.org/show_bug.cgi?id=38123

Reviewers: spatel, craig.topper, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D52148

llvm-svn: 342548
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v4-and-icmp-eq-to-icmp-ule.ll
llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v4-and-icmp-ne-to-icmp-ugt.ll