Support for custom lowering of ISD::RET.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 6 Jan 2006 00:41:43 +0000 (00:41 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 6 Jan 2006 00:41:43 +0000 (00:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25116 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 3e470f25b6f13a37482a8369d593deed4880341b..e7368f0a0cc0369b72b5f36b65133d640471f0b0 100644 (file)
@@ -1302,6 +1302,22 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
       break;
     }
     }
+
+    MVT::ValueType VT = Node->getValueType(0);
+    switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
+    default: assert(0 && "This action is not supported yet!");
+    case TargetLowering::Custom: {
+      SDOperand Tmp = TLI.LowerOperation(Result, DAG);
+      if (Tmp.Val) {
+        Result = LegalizeOp(Tmp);
+        break;
+      }
+      // FALLTHROUGH if the target thinks it is legal.
+    }
+    case TargetLowering::Legal:
+      // Nothing to do.
+      break;
+    }
     break;
   case ISD::STORE: {
     Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.