mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Clean up some codes in InstCombiner::SimplifyDemandedBits().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35446 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
974777868c
commit
d48653a3ab
@ -1135,10 +1135,9 @@ bool InstCombiner::SimplifyDemandedBits(Value *V, APInt DemandedMask,
|
||||
uint32_t SrcBitWidth = SrcTy->getBitWidth();
|
||||
|
||||
DemandedMask &= SrcTy->getMask().zext(BitWidth);
|
||||
uint32_t zextBf = SrcTy->getBitWidth();
|
||||
DemandedMask.trunc(zextBf);
|
||||
RHSKnownZero.trunc(zextBf);
|
||||
RHSKnownOne.trunc(zextBf);
|
||||
DemandedMask.trunc(SrcBitWidth);
|
||||
RHSKnownZero.trunc(SrcBitWidth);
|
||||
RHSKnownOne.trunc(SrcBitWidth);
|
||||
if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
|
||||
RHSKnownZero, RHSKnownOne, Depth+1))
|
||||
return true;
|
||||
@ -1168,10 +1167,9 @@ bool InstCombiner::SimplifyDemandedBits(Value *V, APInt DemandedMask,
|
||||
if ((NewBits & DemandedMask) != 0)
|
||||
InputDemandedBits |= InSignBit;
|
||||
|
||||
uint32_t sextBf = SrcTy->getBitWidth();
|
||||
InputDemandedBits.trunc(sextBf);
|
||||
RHSKnownZero.trunc(sextBf);
|
||||
RHSKnownOne.trunc(sextBf);
|
||||
InputDemandedBits.trunc(SrcBitWidth);
|
||||
RHSKnownZero.trunc(SrcBitWidth);
|
||||
RHSKnownOne.trunc(SrcBitWidth);
|
||||
if (SimplifyDemandedBits(I->getOperand(0), InputDemandedBits,
|
||||
RHSKnownZero, RHSKnownOne, Depth+1))
|
||||
return true;
|
||||
@ -1193,10 +1191,6 @@ bool InstCombiner::SimplifyDemandedBits(Value *V, APInt DemandedMask,
|
||||
return UpdateValueUsesWith(I, NewCast);
|
||||
} else if (RHSKnownOne[SrcBitWidth-1]) { // Input sign bit known set
|
||||
RHSKnownOne |= NewBits;
|
||||
RHSKnownZero &= ~NewBits;
|
||||
} else { // Input sign bit unknown
|
||||
RHSKnownZero &= ~NewBits;
|
||||
RHSKnownOne &= ~NewBits;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user