[llvm-commits] [llvm] r59786 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
Bill Wendling
isanbard at gmail.com
Thu Nov 20 18:33:36 PST 2008
Author: void
Date: Thu Nov 20 20:33:36 2008
New Revision: 59786
URL: http://llvm.org/viewvc/llvm-project?rev=59786&view=rev
Log:
Generate code for llvm.uadd.with.overflow intrinsic. No conversion support yet.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=59786&r1=59785&r2=59786&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Nov 20 20:33:36 2008
@@ -4109,7 +4109,18 @@
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;
}
More information about the llvm-commits
mailing list