aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-13 06:42:16 +0000
committerChris Lattner <sabre@nondot.org>2006-03-13 06:42:16 +0000
commitb6b17ffbc61025c6b3233787ccce2e6335d60b49 (patch)
treedd4ca81014f2e9b515140f519bc177953e1ab058
parent79dbea5ab4c73243a4f6a09fa1637a618263493e (diff)
downloadexternal_llvm-b6b17ffbc61025c6b3233787ccce2e6335d60b49.zip
external_llvm-b6b17ffbc61025c6b3233787ccce2e6335d60b49.tar.gz
external_llvm-b6b17ffbc61025c6b3233787ccce2e6335d60b49.tar.bz2
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
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 7a4d269..bceca13 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<ConstantSDNode>(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));