summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-04-16 20:55:58 +0000
committerCraig Topper <craig.topper@gmail.com>2017-04-16 20:55:58 +0000
commit0d304f01b4d7839de2d9508d444c348654ed3ee4 (patch)
treebbc9b33a0a6bbc633238ce48832c4694ff6f867c /llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
parentf5f593b674ed031f3f5aa2c44ac705547532d5cb (diff)
downloadbcm5719-llvm-0d304f01b4d7839de2d9508d444c348654ed3ee4.tar.gz
bcm5719-llvm-0d304f01b4d7839de2d9508d444c348654ed3ee4.zip
[InstCombine] In SimplifyDemandedUseBits, don't bother to mask known bits of constants with DemandedMask.
Just because we didn't demand them doesn't mean they aren't known. llvm-svn: 300430
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 4e6f02058d8..246fd6bdf5a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -120,14 +120,14 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
const APInt *C;
if (match(V, m_APInt(C))) {
// We know all of the bits for a scalar constant or a splat vector constant!
- KnownOne = *C & DemandedMask;
- KnownZero = ~KnownOne & DemandedMask;
+ KnownOne = *C;
+ KnownZero = ~KnownOne;
return nullptr;
}
if (isa<ConstantPointerNull>(V)) {
// We know all of the bits for a constant!
KnownOne.clearAllBits();
- KnownZero = DemandedMask;
+ KnownZero.setAllBits();
return nullptr;
}
OpenPOWER on IntegriCloud