From b6b17ffbc61025c6b3233787ccce2e6335d60b49 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 13 Mar 2006 06:42:16 +0000 Subject: [PATCH] I can't convince myself that this is safe, remove the recursive call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26725 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 7a4d269f799..bceca139b7b 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -565,23 +565,6 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask, break; } case ISD::ADD: - if (ConstantSDNode *AA = dyn_cast(Op.getOperand(1))) { - if (SimplifyDemandedBits(Op.getOperand(0), DemandedMask, KnownZero, - KnownOne, TLO, Depth+1)) - return true; - // Compute the KnownOne/KnownZero masks for the constant, so we can set - // KnownZero appropriately if we're adding a constant that has all low - // bits cleared. - ComputeMaskedBits(Op.getOperand(1), - MVT::getIntVTBitMask(Op.getValueType()), - KnownZero2, KnownOne2, Depth+1); - - uint64_t KnownZeroOut = std::min(CountTrailingZeros_64(~KnownZero), - CountTrailingZeros_64(~KnownZero2)); - KnownZero = (1ULL << KnownZeroOut) - 1; - KnownOne = 0; - } - break; case ISD::SUB: // Just use ComputeMaskedBits to compute output bits, there are no // simplifications that can be done here, and sub always demands all input @@ -843,7 +826,8 @@ void TargetLowering::ComputeMaskedBits(SDOperand Op, uint64_t Mask, assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?"); // Output known-0 bits are known if clear or set in both the low clear bits - // common to both LHS & RHS; + // common to both LHS & RHS. For example, 8+(X<<3) is known to have the + // low 3 bits clear. uint64_t KnownZeroOut = std::min(CountTrailingZeros_64(~KnownZero), CountTrailingZeros_64(~KnownZero2)); -- 2.34.1