[InstCombine] Fold x s<= x & (-1 >> y) to x s<= (-1 >> y)
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 14 Jul 2018 20:08:26 +0000 (20:08 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 14 Jul 2018 20:08:26 +0000 (20:08 +0000)
commit1e61e358a4ed048c3900c32dc84a2665c592cc4c
treeba5ab990b610515db09fca9e5bc26b13cc0fa5fd
parentf1a351cf3a36091428bd65e2ab6a7605c183cbbf
[InstCombine] Fold  x s<= x & (-1 >> y)  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: 337107
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sle-to-icmp-sle.ll