From 6862dbc446f2f633f6f4905d07a3bafd96741da2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 29 Jan 2006 21:02:23 +0000 Subject: [PATCH] Fix RET of promoted values on targets that custom expand RET to a target node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25794 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 08f7326debb..44ce9981a62 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1056,14 +1056,15 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { } } - switch (TLI.getOperationAction(Node->getOpcode(), - Node->getValueType(0))) { - default: assert(0 && "This action is not supported yet!"); - case TargetLowering::Legal: break; - case TargetLowering::Custom: - Tmp1 = TLI.LowerOperation(Result, DAG); - if (Tmp1.Val) Result = Tmp1; - break; + if (Result.getOpcode() == ISD::RET) { + switch (TLI.getOperationAction(Result.getOpcode(), MVT::Other)) { + default: assert(0 && "This action is not supported yet!"); + case TargetLowering::Legal: break; + case TargetLowering::Custom: + Tmp1 = TLI.LowerOperation(Result, DAG); + if (Tmp1.Val) Result = Tmp1; + break; + } } break; case ISD::STORE: { -- 2.34.1