[InstCombine] Fold x & (-1 >> y) s< x to x s> (-1 >> y)
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 14 Jul 2018 20:08:47 +0000 (20:08 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 14 Jul 2018 20:08:47 +0000 (20:08 +0000)
commitb972fc3e8a2e9569685a794cad7546d895935ccd
tree3b5b7b3f9d06800c91711eb1ce47bca0be1e6d18
parentedba515baa3d924000f9704890987aaad5d90630
[InstCombine] Fold  x & (-1 >> y) s< x  to  x s> (-1 >> y)

https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/I3O

This pattern is not commutative!
We must make sure not to fold the commuted version!

llvm-svn: 337111
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll