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)
commitbf7550e7ecabb10e7a17e6d5067aa8c87810b46b
tree2f5168b432205c82ea2c9cecf095f9dfc2a8408b
parent629680e499c5df3f8965bfbc5b6100261dce0f5a
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.

llvm-svn: 221325
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/shr-nop.ll