forked from OSchip/llvm-project
[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
This commit is contained in:
parent
f5f593b674
commit
0d304f01b4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue