mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Implement ComputeMaskedBits/SimplifyDemandedBits for ISD::TRUNCATE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
35c3913328
commit
fe8babf689
@ -607,6 +607,16 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask,
|
||||
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
|
||||
break;
|
||||
}
|
||||
case ISD::TRUNCATE: {
|
||||
if (SimplifyDemandedBits(Op.getOperand(0), DemandedMask,
|
||||
KnownZero, KnownOne, TLO, Depth+1))
|
||||
return true;
|
||||
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
|
||||
uint64_t OutMask = MVT::getIntVTBitMask(Op.getValueType());
|
||||
KnownZero &= OutMask;
|
||||
KnownOne &= OutMask;
|
||||
break;
|
||||
}
|
||||
case ISD::AssertZext: {
|
||||
MVT::ValueType VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
|
||||
uint64_t InMask = MVT::getIntVTBitMask(VT);
|
||||
@ -864,6 +874,14 @@ void TargetLowering::ComputeMaskedBits(SDOperand Op, uint64_t Mask,
|
||||
KnownZero, KnownOne, Depth+1);
|
||||
return;
|
||||
}
|
||||
case ISD::TRUNCATE: {
|
||||
ComputeMaskedBits(Op.getOperand(0), Mask, KnownZero, KnownOne, Depth+1);
|
||||
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
|
||||
uint64_t OutMask = MVT::getIntVTBitMask(Op.getValueType());
|
||||
KnownZero &= OutMask;
|
||||
KnownOne &= OutMask;
|
||||
break;
|
||||
}
|
||||
case ISD::AssertZext: {
|
||||
MVT::ValueType VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
|
||||
uint64_t InMask = MVT::getIntVTBitMask(VT);
|
||||
|
Loading…
Reference in New Issue
Block a user