mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Make SimplifyDemandedBits understand BUILD_PAIR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208598 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -848,6 +848,31 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ISD::BUILD_PAIR: {
|
||||
EVT HalfVT = Op.getOperand(0).getValueType();
|
||||
unsigned HalfBitWidth = HalfVT.getScalarSizeInBits();
|
||||
|
||||
APInt MaskLo = NewMask.getLoBits(HalfBitWidth).trunc(HalfBitWidth);
|
||||
APInt MaskHi = NewMask.getHiBits(HalfBitWidth).trunc(HalfBitWidth);
|
||||
|
||||
APInt KnownZeroLo, KnownOneLo;
|
||||
APInt KnownZeroHi, KnownOneHi;
|
||||
|
||||
if (SimplifyDemandedBits(Op.getOperand(0), MaskLo, KnownZeroLo,
|
||||
KnownOneLo, TLO, Depth + 1))
|
||||
return true;
|
||||
|
||||
if (SimplifyDemandedBits(Op.getOperand(1), MaskHi, KnownZeroHi,
|
||||
KnownOneHi, TLO, Depth + 1))
|
||||
return true;
|
||||
|
||||
KnownZero = KnownZeroLo.zext(BitWidth) |
|
||||
KnownZeroHi.zext(BitWidth).shl(HalfBitWidth);
|
||||
|
||||
KnownOne = KnownOneLo.zext(BitWidth) |
|
||||
KnownOneHi.zext(BitWidth).shl(HalfBitWidth);
|
||||
break;
|
||||
}
|
||||
case ISD::ZERO_EXTEND: {
|
||||
unsigned OperandBitWidth =
|
||||
Op.getOperand(0).getValueType().getScalarType().getSizeInBits();
|
||||
|
Reference in New Issue
Block a user