diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-21 02:33:36 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-21 02:33:36 +0000 |
commit | da4948ac8cbc307739e353e64c19a935de1e0230 (patch) | |
tree | 761475449bf2aea9ee1cf45aa868f370b7e824a9 | |
parent | cddd428459a66830b0d072823f94224ace58e625 (diff) |
Generate code for llvm.uadd.with.overflow intrinsic. No conversion support yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59786 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 4bc0128bd5..53bc88d0c3 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -4109,7 +4109,18 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; } case Intrinsic::uadd_with_overflow: { - // TODO: Convert to "ISD::UADDO" instruction. + // Convert to "ISD::UADDO" instruction. + SDValue Op1 = getValue(I.getOperand(1)); + SDValue Op2 = getValue(I.getOperand(2)); + MVT Ty = Op1.getValueType(); + + MVT ValueVTs[] = { Ty, MVT::i1 }; + SDValue Ops[] = { Op1, Op2 }; + + SDValue Result = DAG.getNode(ISD::UADDO, DAG.getVTList(&ValueVTs[0], 2), + &Ops[0], 2); + + setValue(&I, Result); return 0; } |