Replace sra with srl if a single sign bit is required
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Thu, 17 Oct 2013 11:16:57 +0000 (11:16 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Thu, 17 Oct 2013 11:16:57 +0000 (11:16 +0000)
commitf9a5e40b90e5a98cfae5c0f8a42eedd71c849dbc
tree6b2d84bec6f2deb4205d3e6d0f1c26ccc591267a
parent888cbad774acdff580611f6b07daaf96e825b7e7
Replace sra with srl if a single sign bit is required

E.g. (and (sra (i32 x) 31) 2) -> (and (srl (i32 x) 30) 2).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192884 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/PowerPC/rlwimi-and.ll
test/CodeGen/SystemZ/shift-10.ll