InstSimplify: Exact shifts of X by Y are X if X has the lsb set
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 5 Nov 2014 00:59:59 +0000 (00:59 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 5 Nov 2014 00:59:59 +0000 (00:59 +0000)
commit49c14f54b2bba2f9293bcaae5e3a88918dc25e11
treedc3e9dff8c4e7d51e8c582928e6bead09b3b4ff0
parent4cd064b8e86f3d52e9b78e329059bdfffd15d52e
InstSimplify: Exact shifts of X by Y are X if X has the lsb set

Exact shifts may not shift out any non-zero bits. Use computeKnownBits
to determine when this occurs and just return the left hand side.

This fixes PR21477.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221325 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/shr-nop.ll