OSDN Git Service

[SelectionDAG] Teach computeKnownBits some improvements to ISD::SRL with a non-splat...
authorCraig Topper <craig.topper@intel.com>
Mon, 4 Dec 2017 05:38:42 +0000 (05:38 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 4 Dec 2017 05:38:42 +0000 (05:38 +0000)
commit7cd55ac3b8f23fe22e74a72efa40dcab0678fd17
tree59a4e332e2df3d9192a0dd05a68c867e41688297
parent0d0f8ed79851ec8b6dd8acfb877fe9c12ce9321a
[SelectionDAG] Teach computeKnownBits some improvements to ISD::SRL with a non-splat constant shift amount.

If we have a non-splat constant shift amount, the minimum shift amount can be used to infer the number of zero upper bits of the result. There's probably a lot more that we can do here, but this
fixes a case where I wanted to infer the sign bit as zero when all the shift amounts are non-zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319639 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/combine-srl.ll