forked from OSchip/llvm-project
[InstCombine] Remove redundant code from SimplifyDemandedBits handling for Or. The code above it is equivalent if you work through the bitwise math.
llvm-svn: 300876
This commit is contained in:
parent
70b34533c2
commit
0ec3f2f39a
|
@ -225,15 +225,6 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
|
|||
(DemandedMask & ~RHSKnownOne))
|
||||
return I->getOperand(1);
|
||||
|
||||
// If all of the potentially set bits on one side are known to be set on
|
||||
// the other side, just use the 'other' side.
|
||||
if ((DemandedMask & (~RHSKnownZero) & LHSKnownOne) ==
|
||||
(DemandedMask & (~RHSKnownZero)))
|
||||
return I->getOperand(0);
|
||||
if ((DemandedMask & (~LHSKnownZero) & RHSKnownOne) ==
|
||||
(DemandedMask & (~LHSKnownZero)))
|
||||
return I->getOperand(1);
|
||||
|
||||
// If the RHS is a constant, see if we can simplify it.
|
||||
if (ShrinkDemandedConstant(I, 1, DemandedMask))
|
||||
return I;
|
||||
|
@ -819,15 +810,6 @@ Value *InstCombiner::SimplifyMultipleUseDemandedBits(Instruction *I,
|
|||
(DemandedMask & ~RHSKnownOne))
|
||||
return I->getOperand(1);
|
||||
|
||||
// If all of the potentially set bits on one side are known to be set on
|
||||
// the other side, just use the 'other' side.
|
||||
if ((DemandedMask & (~RHSKnownZero) & LHSKnownOne) ==
|
||||
(DemandedMask & (~RHSKnownZero)))
|
||||
return I->getOperand(0);
|
||||
if ((DemandedMask & (~LHSKnownZero) & RHSKnownOne) ==
|
||||
(DemandedMask & (~LHSKnownZero)))
|
||||
return I->getOperand(1);
|
||||
|
||||
KnownZero = std::move(IKnownZero);
|
||||
KnownOne = std::move(IKnownOne);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue