From ab55ebda1c2254f98b06e770bc2dae7d05a4a366 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 12 Dec 2008 00:56:36 +0000 Subject: Redo the arithmetic with overflow architecture. I was changing the semantics of ISD::ADD to emit an implicit EFLAGS. This was horribly broken. Instead, replace the intrinsic with an ISD::SADDO node. Then custom lower that into an X86ISD::ADD node with a associated SETCC that checks the correct condition code (overflow or carry). Then that gets lowered into the correct X86::ADDOvf instruction. Similar for SUB and MUL instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60915 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 314697df17..6538417655 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -967,11 +967,6 @@ SDValue DAGCombiner::visitADD(SDNode *N) { if (FoldedVOp.getNode()) return FoldedVOp; } - if (N->getNumValues() != 1) - // FIXME: DAG combiner cannot handle arithmetic operators which produce - // multiple results. - return SDValue(); - // fold (add x, undef) -> undef if (N0.getOpcode() == ISD::UNDEF) return N0; @@ -1167,11 +1162,6 @@ SDValue DAGCombiner::visitSUB(SDNode *N) { if (FoldedVOp.getNode()) return FoldedVOp; } - if (N->getNumValues() != 1) - // FIXME: DAG combiner cannot handle arithmetic operators which produce - // multiple results. - return SDValue(); - // fold (sub x, x) -> 0 if (N0 == N1) return DAG.getConstant(0, N->getValueType(0)); @@ -1230,11 +1220,6 @@ SDValue DAGCombiner::visitMUL(SDNode *N) { if (FoldedVOp.getNode()) return FoldedVOp; } - if (N->getNumValues() != 1) - // FIXME: DAG combiner cannot handle arithmetic operators which produce - // multiple results. - return SDValue(); - // fold (mul x, undef) -> 0 if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) return DAG.getConstant(0, VT); -- cgit v1.2.3-70-g09d2