From d1d3e67d305a461ec80e3029f9401da990702e48 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Sun, 22 Jun 2008 09:42:16 +0000 Subject: [PATCH] Make custom lowering of ADD work correctly. This fixes PR2476; patch by Richard Osborne. The same problem exists for a bunch of other operators, but I'm ignoring this because they will be automagically fixed when the new LegalizeTypes infrastructure lands, since it already solves this problem centrally. llvm-svn: 52610 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 3be33770bc8..bf1608d4c29 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -6374,9 +6374,9 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){ // If the target wants to custom expand this, let them. if (TLI.getOperationAction(Node->getOpcode(), VT) == TargetLowering::Custom) { - Op = TLI.LowerOperation(Op, DAG); - if (Op.Val) { - ExpandOp(Op, Lo, Hi); + SDOperand Result = TLI.LowerOperation(Op, DAG); + if (Result.Val) { + ExpandOp(Result, Lo, Hi); break; } }