summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 8028eb3567e..60a62ed39f2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1834,6 +1834,12 @@ SDValue DAGCombiner::visitADDLike(SDValue N0, SDValue N1, SDNode *LocReference)
}
}
+ // (add X, (adde Y, 0, Carry)) -> (adde X, Y, Carry)
+ if (N1.getOpcode() == ISD::ADDE && N1->hasOneUse() &&
+ isNullConstant(N1.getOperand(1)))
+ return DAG.getNode(ISD::ADDE, DL, DAG.getVTList(VT, MVT::Glue),
+ N0, N1->getOperand(0), N1->getOperand(2));
+
return SDValue();
}
OpenPOWER on IntegriCloud