diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-12-12 18:49:09 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-12-12 18:49:09 +0000 |
commit | 637ed03173fdd154b1736e09358ba608036952b7 (patch) | |
tree | fd0cb65fbf9d192294927143128f1317b23b7303 /lib | |
parent | 8bdc6920cdd1fd51e5af1537462c30c06203fe85 (diff) | |
download | external_llvm-637ed03173fdd154b1736e09358ba608036952b7.zip external_llvm-637ed03173fdd154b1736e09358ba608036952b7.tar.gz external_llvm-637ed03173fdd154b1736e09358ba608036952b7.tar.bz2 |
Fix add/sub expansion: don't create ADD / SUB with two results (seems like everyone is doing this these days :-). Patch by Daniel M Gessel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 1ec9bb1..0a10e4f 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -6862,7 +6862,6 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){ SDValue LHSL, LHSH, RHSL, RHSH; ExpandOp(Node->getOperand(0), LHSL, LHSH); ExpandOp(Node->getOperand(1), RHSL, RHSH); - SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); SDValue LoOps[2], HiOps[3]; LoOps[0] = LHSL; LoOps[1] = RHSL; @@ -6881,6 +6880,7 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){ } if(hasCarry) { + SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); if (Node->getOpcode() == ISD::ADD) { Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); HiOps[2] = Lo.getValue(1); @@ -6893,8 +6893,8 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){ break; } else { if (Node->getOpcode() == ISD::ADD) { - Lo = DAG.getNode(ISD::ADD, VTList, LoOps, 2); - Hi = DAG.getNode(ISD::ADD, VTList, HiOps, 2); + Lo = DAG.getNode(ISD::ADD, NVT, LoOps, 2); + Hi = DAG.getNode(ISD::ADD, NVT, HiOps, 2); SDValue Cmp1 = DAG.getSetCC(TLI.getSetCCResultType(Lo), Lo, LoOps[0], ISD::SETULT); SDValue Carry1 = DAG.getNode(ISD::SELECT, NVT, Cmp1, @@ -6907,8 +6907,8 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){ Carry1); Hi = DAG.getNode(ISD::ADD, NVT, Hi, Carry2); } else { - Lo = DAG.getNode(ISD::SUB, VTList, LoOps, 2); - Hi = DAG.getNode(ISD::SUB, VTList, HiOps, 2); + Lo = DAG.getNode(ISD::SUB, NVT, LoOps, 2); + Hi = DAG.getNode(ISD::SUB, NVT, HiOps, 2); SDValue Cmp = DAG.getSetCC(NVT, LoOps[0], LoOps[1], ISD::SETULT); SDValue Borrow = DAG.getNode(ISD::SELECT, NVT, Cmp, DAG.getConstant(1, NVT), |