summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2017-02-06 14:59:06 +0000
committerAmaury Sechet <deadalnix@gmail.com>2017-02-06 14:59:06 +0000
commite674f5c75857fca395407110f151dfc8d6c291ef (patch)
tree054a32cb5093e840444907bd22313f68984dea1a /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent8a3b32941de6a258d02f9a3acba5c4c9dfc87257 (diff)
downloadbcm5719-llvm-e674f5c75857fca395407110f151dfc8d6c291ef.tar.gz
bcm5719-llvm-e674f5c75857fca395407110f151dfc8d6c291ef.zip
Add ADDC to SelectionDAG::computeKnownBits and ComputeNumSignBits.
Summary: As per title. Reviewers: bkramer, sunfish, lattner, RKSimon Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29521 llvm-svn: 294188
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index b9f6fc0f1ab..9e802b99ed4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2506,6 +2506,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
LLVM_FALLTHROUGH;
}
case ISD::ADD:
+ case ISD::ADDC:
case ISD::ADDE: {
// Output known-0 bits are known if clear or set in both the low clear bits
// common to both LHS & RHS. For example, 8+(X<<3) is known to have the
@@ -2526,7 +2527,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
KnownZeroLow = std::min(KnownZeroLow,
KnownZero2.countTrailingOnes());
- if (Opcode == ISD::ADD) {
+ if (Opcode == ISD::ADD || Opcode == ISD::ADDC) {
KnownZero |= APInt::getLowBitsSet(BitWidth, KnownZeroLow);
if (KnownZeroHigh > 1)
KnownZero |= APInt::getHighBitsSet(BitWidth, KnownZeroHigh - 1);
@@ -2945,6 +2946,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const {
}
break;
case ISD::ADD:
+ case ISD::ADDC:
// Add can have at most one carry bit. Thus we know that the output
// is, at worst, one more bit than the inputs.
Tmp = ComputeNumSignBits(Op.getOperand(0), Depth+1);
OpenPOWER on IntegriCloud