From: Chris Lattner Date: Sat, 28 Jan 2006 08:31:04 +0000 (+0000) Subject: minor tweaks X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=948c1b1cda280c6428dbeaa03a6c2c559dbb93f4;p=oota-llvm.git minor tweaks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25740 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index a7f488e0f0b..0f455d431a6 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -266,6 +266,23 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { bool isCustom = false; switch (Node->getOpcode()) { + case ISD::FrameIndex: + case ISD::EntryToken: + case ISD::Register: + case ISD::BasicBlock: + case ISD::TargetFrameIndex: + case ISD::TargetConstant: + case ISD::TargetConstantPool: + case ISD::TargetGlobalAddress: + case ISD::TargetExternalSymbol: + case ISD::VALUETYPE: + case ISD::SRCVALUE: + case ISD::STRING: + case ISD::CONDCODE: + // Primitives must all be legal. + assert(TLI.isOperationLegal(Node->getValueType(0), Node->getValueType(0)) && + "This must be legal!"); + break; default: if (Node->getOpcode() >= ISD::BUILTIN_OP_END) { // If this is a target node, legalize it by legalizing the operands then @@ -293,33 +310,16 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { std::cerr << "NODE: "; Node->dump(); std::cerr << "\n"; assert(0 && "Do not know how to legalize this operator!"); abort(); - case ISD::EntryToken: - case ISD::FrameIndex: - case ISD::TargetFrameIndex: - case ISD::Register: - case ISD::TargetConstant: - case ISD::TargetConstantPool: case ISD::GlobalAddress: - case ISD::TargetGlobalAddress: case ISD::ExternalSymbol: - case ISD::TargetExternalSymbol: case ISD::ConstantPool: // Nothing to do. - case ISD::BasicBlock: - case ISD::CONDCODE: - case ISD::VALUETYPE: - case ISD::SRCVALUE: - case ISD::STRING: switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) { default: assert(0 && "This action is not supported yet!"); - case TargetLowering::Custom: { - SDOperand Tmp = TLI.LowerOperation(Op, DAG); - if (Tmp.Val) { - Result = Tmp; - break; - } - } // FALLTHROUGH if the target doesn't want to lower this op after all. + case TargetLowering::Custom: + Tmp1 = TLI.LowerOperation(Op, DAG); + if (Tmp1.Val) Result = Tmp1; + // FALLTHROUGH if the target doesn't want to lower this op after all. case TargetLowering::Legal: - assert(isTypeLegal(Node->getValueType(0)) && "This must be legal!"); break; } break;