add support for custom lowering SINT_TO_FP
authorAndrew Lenharth <andrewl@lenharth.org>
Wed, 30 Nov 2005 06:43:03 +0000 (06:43 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Wed, 30 Nov 2005 06:43:03 +0000 (06:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24531 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 2f3d21d81bb7805935b82031f2a81f11668dfe7f..e12e69a4dcb565fc846230f4e584ec5a9539f379 100644 (file)
@@ -1956,6 +1956,19 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
         return Result;
       case TargetLowering::Legal:
         break;
+      case TargetLowering::Custom: {
+        Tmp1 = LegalizeOp(Node->getOperand(0));
+        SDOperand Tmp =
+          DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1);
+        Tmp = TLI.LowerOperation(Tmp, DAG);
+        if (Tmp.Val) {
+          AddLegalizedOperand(Op, Tmp);
+          NeedsAnotherIteration = true;
+          return Tmp;
+        } else {
+          assert(0 && "Target Must Lower this");
+        }
+      }
       }
 
       Tmp1 = LegalizeOp(Node->getOperand(0));