]> granicus.if.org Git - llvm/commit
[InstCombine] Fix a weakness in canEvaluateZExtd around 'and' instructions
authorCraig Topper <craig.topper@intel.com>
Mon, 21 Aug 2017 16:04:11 +0000 (16:04 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 21 Aug 2017 16:04:11 +0000 (16:04 +0000)
commit1952c98f8be40ea3b011e021c8cc59d1ee9f7435
treea5980f1863f7b6fea2f71ada2da17aa6e1d97b82
parent51f04d9893abe499d982c052304796a25083ba3c
[InstCombine] Fix a weakness in canEvaluateZExtd around 'and' instructions

Summary:
If the bitsToClear from the LHS of an 'and' comes back non-zero, but all of those bits are known zero on the RHS, we can reset bitsToClear.

Without this, the 'or' in the modified test case blocks the transform because it has non-zero bits in its RHS in those bits.

Reviewers: spatel, majnemer, davide

Reviewed By: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311343 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/cast.ll