From 17c428e23dbeac1f985d725905ce6be1c725491f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 6 Jan 2006 00:41:43 +0000 Subject: [PATCH] Support for custom lowering of ISD::RET. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25116 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 3e470f25b6f..e7368f0a0cc 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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.