Make custom lowering of ADD work correctly. This
authorDuncan Sands <baldrick@free.fr>
Sun, 22 Jun 2008 09:42:16 +0000 (09:42 +0000)
committerDuncan Sands <baldrick@free.fr>
Sun, 22 Jun 2008 09:42:16 +0000 (09:42 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52610 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 3be33770bc88fee9615dbd13a68c3a8635c9fd63..bf1608d4c2989036b9926f5f645a6214e968cf91 100644 (file)
@@ -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;
       }
     }