diff options
author | Amaury Sechet <deadalnix@gmail.com> | 2017-05-02 13:34:25 +0000 |
---|---|---|
committer | Amaury Sechet <deadalnix@gmail.com> | 2017-05-02 13:34:25 +0000 |
commit | 153911f71d3a07d9dd131668a69283935a06c1c5 (patch) | |
tree | a0e8e61dcf1a1e1ed1b4bc83e23e26a5b53b3685 /llvm/lib | |
parent | 59bc6d1ce0c0ff93e91dede772b6693681632944 (diff) | |
download | bcm5719-llvm-153911f71d3a07d9dd131668a69283935a06c1c5.tar.gz bcm5719-llvm-153911f71d3a07d9dd131668a69283935a06c1c5.zip |
[DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Summary: Common pattern when legalizing large integers operations. Similar to D32687, when the carry isn't used.
Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer
Differential Revision: https://reviews.llvm.org/D32738
llvm-svn: 301919
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index c2200742add..559a8552959 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2015,6 +2015,11 @@ SDValue DAGCombiner::visitADDLike(SDValue N0, SDValue N1, SDNode *LocReference) } } + // (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry) + if (N1.getOpcode() == ISD::ADDCARRY && isNullConstant(N1.getOperand(1))) + return DAG.getNode(ISD::ADDCARRY, DL, N1->getVTList(), + N0, N1.getOperand(0), N1.getOperand(2)); + return SDValue(); } |