]> granicus.if.org Git - llvm/commit
[SelectionDAG] Teach GetDemandedBits to look at the known zeros of the LHS when handl...
authorCraig Topper <craig.topper@intel.com>
Wed, 20 Feb 2019 20:52:26 +0000 (20:52 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 20 Feb 2019 20:52:26 +0000 (20:52 +0000)
commitfebe1abd953836b44ecd2a6b16963c9a62d31de4
tree0dbb17d2ff2f2454c6b28e86f1e6a6ef456ad3ee
parent8781462495961b514aaf57127ec8f3c30d591236
[SelectionDAG] Teach GetDemandedBits to look at the known zeros of the LHS when handling ISD::AND

If the LHS has known zeros, then the RHS immediate mask might have been simplified to remove those bits.

This patch adds a call to computeKnownBits to get the known zeroes to handle that possibility. I left an early out to skip the call if all of the demanded bits are set in the mask.

Differential Revision: https://reviews.llvm.org/D58464

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