[llvm-commits] [llvm] r53403 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeIntegerTypes.cpp LegalizeTypes.cpp LegalizeTypes.h LegalizeTypesGeneric.cpp LegalizeVectorTypes.cpp

Duncan Sands baldrick at free.fr
Thu Jul 10 08:25:07 PDT 2008


Author: baldrick
Date: Thu Jul 10 10:25:04 2008
New Revision: 53403

URL: http://llvm.org/viewvc/llvm-project?rev=53403&view=rev
Log:
Make the LegalizeType method naming scheme more regular.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53403&r1=53402&r2=53403&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Thu Jul 10 10:25:04 2008
@@ -251,11 +251,11 @@
   case ExpandInteger:
   case ExpandFloat:
     break;
-  case Scalarize:
+  case ScalarizeVector:
     // Convert the element to an integer and promote it by hand.
     return DAG.getNode(ISD::ANY_EXTEND, OutVT,
                        BitConvertToInteger(GetScalarizedVector(InOp)));
-  case Split:
+  case SplitVector:
     // For example, i32 = BIT_CONVERT v2i16 on alpha.  Convert the split
     // pieces of the input into integers and reassemble in the final type.
     SDOperand Lo, Hi;

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=53403&r1=53402&r2=53403&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Thu Jul 10 10:25:04 2008
@@ -83,11 +83,11 @@
       case ExpandFloat:
         ExpandFloatResult(N, i);
         goto NodeDone;
-      case Scalarize:
-        ScalarizeResult(N, i);
+      case ScalarizeVector:
+        ScalarizeVectorResult(N, i);
         goto NodeDone;
-      case Split:
-        SplitResult(N, i);
+      case SplitVector:
+        SplitVectorResult(N, i);
         goto NodeDone;
       }
     } while (++i < NumResults);
@@ -116,11 +116,11 @@
       case ExpandFloat:
         NeedsRevisit = ExpandFloatOperand(N, i);
         break;
-      case Scalarize:
-        NeedsRevisit = ScalarizeOperand(N, i);
+      case ScalarizeVector:
+        NeedsRevisit = ScalarizeVectorOperand(N, i);
         break;
-      case Split:
-        NeedsRevisit = SplitOperand(N, i);
+      case SplitVector:
+        NeedsRevisit = SplitVectorOperand(N, i);
         break;
       }
       break;

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53403&r1=53402&r2=53403&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Thu Jul 10 10:25:04 2008
@@ -26,16 +26,10 @@
 namespace llvm {
 
 //===----------------------------------------------------------------------===//
-/// DAGTypeLegalizer - This takes an arbitrary SelectionDAG as input and
-/// hacks on it until the target machine can handle it.  This involves
-/// eliminating value sizes the machine cannot handle (promoting small sizes to
-/// large sizes or splitting up large values into small values) as well as
-/// eliminating operations the machine cannot handle.
-///
-/// This code also does a small amount of optimization and recognition of idioms
-/// as part of its processing.  For example, if a target does not support a
-/// 'setcc' instruction efficiently, but does support 'brcc' instruction, this
-/// will attempt merge setcc and brc instructions into brcc's.
+/// DAGTypeLegalizer - This takes an arbitrary SelectionDAG as input and hacks
+/// on it until only value types the target machine can handle are left.  This
+/// involves promoting small sizes to large sizes or splitting up large values
+/// into small values.
 ///
 class VISIBILITY_HIDDEN DAGTypeLegalizer {
   TargetLowering &TLI;
@@ -59,13 +53,13 @@
   };
 private:
   enum LegalizeAction {
-    Legal,          // The target natively supports this type.
-    PromoteInteger, // Replace this integer type with a larger one.
-    ExpandInteger,  // Split this integer type into two of half the size.
-    SoftenFloat,    // Convert this float type to a same size integer type.
-    ExpandFloat,    // Split this float type into two of half the size.
-    Scalarize,      // Replace this one-element vector type with its element type.
-    Split           // This vector type should be split into smaller vectors.
+    Legal,           // The target natively supports this type.
+    PromoteInteger,  // Replace this integer type with a larger one.
+    ExpandInteger,   // Split this integer type into two of half the size.
+    SoftenFloat,     // Convert this float type to a same size integer type.
+    ExpandFloat,     // Split this float type into two of half the size.
+    ScalarizeVector, // Replace this one-element vector with its element type.
+    SplitVector      // This vector type should be split into smaller vectors.
   };
 
   /// ValueTypeActions - This is a bitvector that contains two bits for each
@@ -76,8 +70,8 @@
   /// getTypeAction - Return how we should legalize values of this type, either
   /// it is already legal, or we need to promote it to a larger integer type, or
   /// we need to expand it into multiple registers of a smaller integer type, or
-  /// we need to scalarize a one-element vector type into the element type, or
-  /// we need to split a vector type into smaller vector types.
+  /// we need to split a vector type into smaller vector types, or we need to
+  /// convert it to a different type of the same size.
   LegalizeAction getTypeAction(MVT VT) const {
     switch (ValueTypeActions.getTypeAction(VT)) {
     default:
@@ -99,9 +93,9 @@
         else
           return ExpandFloat;
       } else if (VT.getVectorNumElements() == 1) {
-        return Scalarize;
+        return ScalarizeVector;
       } else {
-        return Split;
+        return SplitVector;
       }
     }
   }
@@ -400,7 +394,7 @@
   void SetScalarizedVector(SDOperand Op, SDOperand Result);
 
   // Vector Result Scalarization: <1 x ty> -> ty.
-  void ScalarizeResult(SDNode *N, unsigned OpNo);
+  void ScalarizeVectorResult(SDNode *N, unsigned OpNo);
   SDOperand ScalarizeVecRes_BinOp(SDNode *N);
   SDOperand ScalarizeVecRes_UnaryOp(SDNode *N);
 
@@ -413,7 +407,7 @@
   SDOperand ScalarizeVecRes_VECTOR_SHUFFLE(SDNode *N);
 
   // Vector Operand Scalarization: <1 x ty> -> ty.
-  bool ScalarizeOperand(SDNode *N, unsigned OpNo);
+  bool ScalarizeVectorOperand(SDNode *N, unsigned OpNo);
   SDOperand ScalarizeVecOp_BIT_CONVERT(SDNode *N);
   SDOperand ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *N);
   SDOperand ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo);
@@ -426,7 +420,7 @@
   void SetSplitVector(SDOperand Op, SDOperand Lo, SDOperand Hi);
 
   // Vector Result Splitting: <128 x ty> -> 2 x <64 x ty>.
-  void SplitResult(SDNode *N, unsigned OpNo);
+  void SplitVectorResult(SDNode *N, unsigned OpNo);
 
   void SplitVecRes_UNDEF(SDNode *N, SDOperand &Lo, SDOperand &Hi);
   void SplitVecRes_LOAD(LoadSDNode *N, SDOperand &Lo, SDOperand &Hi);
@@ -442,7 +436,7 @@
   void SplitVecRes_FPOWI(SDNode *N, SDOperand &Lo, SDOperand &Hi);
 
   // Vector Operand Splitting: <128 x ty> -> 2 x <64 x ty>.
-  bool SplitOperand(SDNode *N, unsigned OpNo);
+  bool SplitVectorOperand(SDNode *N, unsigned OpNo);
 
   SDOperand SplitVecOp_BIT_CONVERT(SDNode *N);
   SDOperand SplitVecOp_EXTRACT_SUBVECTOR(SDNode *N);

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp?rev=53403&r1=53402&r2=53403&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp Thu Jul 10 10:25:04 2008
@@ -54,7 +54,7 @@
       Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Lo);
       Hi = DAG.getNode(ISD::BIT_CONVERT, NVT, Hi);
       return;
-    case Split:
+    case SplitVector:
       // Convert the split parts of the input if it was split in two.
       GetSplitVector(InOp, Lo, Hi);
       if (Lo.getValueType() == Hi.getValueType()) {
@@ -65,7 +65,7 @@
         return;
       }
       break;
-    case Scalarize:
+    case ScalarizeVector:
       // Convert the element instead.
       SplitInteger(BitConvertToInteger(GetScalarizedVector(InOp)), Lo, Hi);
       Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Lo);

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53403&r1=53402&r2=53403&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Thu Jul 10 10:25:04 2008
@@ -27,7 +27,7 @@
 //  Result Vector Scalarization: <1 x ty> -> ty.
 //===----------------------------------------------------------------------===//
 
-void DAGTypeLegalizer::ScalarizeResult(SDNode *N, unsigned ResNo) {
+void DAGTypeLegalizer::ScalarizeVectorResult(SDNode *N, unsigned ResNo) {
   DEBUG(cerr << "Scalarize node result " << ResNo << ": "; N->dump(&DAG);
         cerr << "\n");
   SDOperand R = SDOperand();
@@ -35,7 +35,7 @@
   switch (N->getOpcode()) {
   default:
 #ifndef NDEBUG
-    cerr << "ScalarizeResult #" << ResNo << ": ";
+    cerr << "ScalarizeVectorResult #" << ResNo << ": ";
     N->dump(&DAG); cerr << "\n";
 #endif
     assert(0 && "Do not know how to scalarize the result of this operator!");
@@ -147,7 +147,7 @@
 //  Operand Vector Scalarization <1 x ty> -> ty.
 //===----------------------------------------------------------------------===//
 
-bool DAGTypeLegalizer::ScalarizeOperand(SDNode *N, unsigned OpNo) {
+bool DAGTypeLegalizer::ScalarizeVectorOperand(SDNode *N, unsigned OpNo) {
   DEBUG(cerr << "Scalarize node operand " << OpNo << ": "; N->dump(&DAG);
         cerr << "\n");
   SDOperand Res = SDOperand();
@@ -156,7 +156,7 @@
     switch (N->getOpcode()) {
     default:
 #ifndef NDEBUG
-      cerr << "ScalarizeOperand Op #" << OpNo << ": ";
+      cerr << "ScalarizeVectorOperand Op #" << OpNo << ": ";
       N->dump(&DAG); cerr << "\n";
 #endif
       assert(0 && "Do not know how to scalarize this operator's operand!");
@@ -222,19 +222,19 @@
 //  Result Vector Splitting
 //===----------------------------------------------------------------------===//
 
-/// SplitResult - This method is called when the specified result of the
+/// SplitVectorResult - This method is called when the specified result of the
 /// specified node is found to need vector splitting.  At this point, the node
 /// may also have invalid operands or may have other results that need
 /// legalization, we just know that (at least) one result needs vector
 /// splitting.
-void DAGTypeLegalizer::SplitResult(SDNode *N, unsigned ResNo) {
+void DAGTypeLegalizer::SplitVectorResult(SDNode *N, unsigned ResNo) {
   DEBUG(cerr << "Split node result: "; N->dump(&DAG); cerr << "\n");
   SDOperand Lo, Hi;
 
   switch (N->getOpcode()) {
   default:
 #ifndef NDEBUG
-    cerr << "SplitResult #" << ResNo << ": ";
+    cerr << "SplitVectorResult #" << ResNo << ": ";
     N->dump(&DAG); cerr << "\n";
 #endif
     assert(0 && "Do not know how to split the result of this operator!");
@@ -456,7 +456,7 @@
   case Legal:
   case PromoteInteger:
   case SoftenFloat:
-  case Scalarize:
+  case ScalarizeVector:
     break;
   case ExpandInteger:
   case ExpandFloat:
@@ -472,7 +472,7 @@
       return;
     }
     break;
-  case Split:
+  case SplitVector:
     // If the input is a vector that needs to be split, convert each split
     // piece of the input now.
     GetSplitVector(InOp, Lo, Hi);
@@ -529,11 +529,11 @@
 //  Operand Vector Splitting
 //===----------------------------------------------------------------------===//
 
-/// SplitOperand - This method is called when the specified operand of the
+/// SplitVectorOperand - This method is called when the specified operand of the
 /// specified node is found to need vector splitting.  At this point, all of the
 /// result types of the node are known to be legal, but other operands of the
 /// node may need legalization as well as the specified one.
-bool DAGTypeLegalizer::SplitOperand(SDNode *N, unsigned OpNo) {
+bool DAGTypeLegalizer::SplitVectorOperand(SDNode *N, unsigned OpNo) {
   DEBUG(cerr << "Split node operand: "; N->dump(&DAG); cerr << "\n");
   SDOperand Res = SDOperand();
 
@@ -541,7 +541,7 @@
     switch (N->getOpcode()) {
     default:
 #ifndef NDEBUG
-      cerr << "SplitOperand Op #" << OpNo << ": ";
+      cerr << "SplitVectorOperand Op #" << OpNo << ": ";
       N->dump(&DAG); cerr << "\n";
 #endif
       assert(0 && "Do not know how to split this operator's operand!");





More information about the llvm-commits mailing list