mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Rename ComputeMaskedBits to computeKnownBits. "Masked" has been
inappropriate since it lost its Mask parameter in r154011. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -386,7 +386,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
|
||||
if (Depth != 0) {
|
||||
// If not at the root, Just compute the KnownZero/KnownOne bits to
|
||||
// simplify things downstream.
|
||||
TLO.DAG.ComputeMaskedBits(Op, KnownZero, KnownOne, Depth);
|
||||
TLO.DAG.computeKnownBits(Op, KnownZero, KnownOne, Depth);
|
||||
return false;
|
||||
}
|
||||
// If this is the root being simplified, allow it to have multiple uses,
|
||||
@ -416,7 +416,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
|
||||
if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
|
||||
APInt LHSZero, LHSOne;
|
||||
// Do not increment Depth here; that can cause an infinite loop.
|
||||
TLO.DAG.ComputeMaskedBits(Op.getOperand(0), LHSZero, LHSOne, Depth);
|
||||
TLO.DAG.computeKnownBits(Op.getOperand(0), LHSZero, LHSOne, Depth);
|
||||
// If the LHS already has zeros where RHSC does, this and is dead.
|
||||
if ((LHSZero & NewMask) == (~RHSC->getAPIntValue() & NewMask))
|
||||
return TLO.CombineTo(Op, Op.getOperand(0));
|
||||
@ -1065,8 +1065,8 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
|
||||
}
|
||||
// FALL THROUGH
|
||||
default:
|
||||
// Just use ComputeMaskedBits to compute output bits.
|
||||
TLO.DAG.ComputeMaskedBits(Op, KnownZero, KnownOne, Depth);
|
||||
// Just use computeKnownBits to compute output bits.
|
||||
TLO.DAG.computeKnownBits(Op, KnownZero, KnownOne, Depth);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1078,14 +1078,14 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// computeMaskedBitsForTargetNode - Determine which of the bits specified
|
||||
/// computeKnownBitsForTargetNode - Determine which of the bits specified
|
||||
/// in Mask are known to be either zero or one and return them in the
|
||||
/// KnownZero/KnownOne bitsets.
|
||||
void TargetLowering::computeMaskedBitsForTargetNode(const SDValue Op,
|
||||
APInt &KnownZero,
|
||||
APInt &KnownOne,
|
||||
const SelectionDAG &DAG,
|
||||
unsigned Depth) const {
|
||||
void TargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
|
||||
APInt &KnownZero,
|
||||
APInt &KnownOne,
|
||||
const SelectionDAG &DAG,
|
||||
unsigned Depth) const {
|
||||
assert((Op.getOpcode() >= ISD::BUILTIN_OP_END ||
|
||||
Op.getOpcode() == ISD::INTRINSIC_WO_CHAIN ||
|
||||
Op.getOpcode() == ISD::INTRINSIC_W_CHAIN ||
|
||||
@ -1111,7 +1111,7 @@ unsigned TargetLowering::ComputeNumSignBitsForTargetNode(SDValue Op,
|
||||
}
|
||||
|
||||
/// ValueHasExactlyOneBitSet - Test if the given value is known to have exactly
|
||||
/// one bit set. This differs from ComputeMaskedBits in that it doesn't need to
|
||||
/// one bit set. This differs from computeKnownBits in that it doesn't need to
|
||||
/// determine which bit is set.
|
||||
///
|
||||
static bool ValueHasExactlyOneBitSet(SDValue Val, const SelectionDAG &DAG) {
|
||||
@ -1134,11 +1134,11 @@ static bool ValueHasExactlyOneBitSet(SDValue Val, const SelectionDAG &DAG) {
|
||||
// More could be done here, though the above checks are enough
|
||||
// to handle some common cases.
|
||||
|
||||
// Fall back to ComputeMaskedBits to catch other known cases.
|
||||
// Fall back to computeKnownBits to catch other known cases.
|
||||
EVT OpVT = Val.getValueType();
|
||||
unsigned BitWidth = OpVT.getScalarType().getSizeInBits();
|
||||
APInt KnownZero, KnownOne;
|
||||
DAG.ComputeMaskedBits(Val, KnownZero, KnownOne);
|
||||
DAG.computeKnownBits(Val, KnownZero, KnownOne);
|
||||
return (KnownZero.countPopulation() == BitWidth - 1) &&
|
||||
(KnownOne.countPopulation() == 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user