[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Jan 28 00:31:16 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.287 -> 1.288
---
Log message:

minor tweaks


---
Diffs of the changes:  (+21 -21)

 LegalizeDAG.cpp |   42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.287 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.288
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.287	Sat Jan 28 02:25:58 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Sat Jan 28 02:31:04 2006
@@ -266,6 +266,23 @@
   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 @@
     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;






More information about the llvm-commits mailing list