Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
authorDan Gohman <gohman@apple.com>
Wed, 27 Jun 2007 16:08:04 +0000 (16:08 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 27 Jun 2007 16:08:04 +0000 (16:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37758 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ValueTypes.h
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/VMCore/ValueTypes.cpp

index 211bc28123a0aa5fb318695c4b9652806057a620..d2a6414fcc59aaf39caba4e3fbdaa280d91394db 100644 (file)
@@ -95,9 +95,9 @@ namespace MVT {  // MVT = Machine Value Types
   static const uint32_t SimpleTypeMask =
     (~uint32_t(0) << (32 - SimpleTypeBits)) >> (32 - SimpleTypeBits);
 
   static const uint32_t SimpleTypeMask =
     (~uint32_t(0) << (32 - SimpleTypeBits)) >> (32 - SimpleTypeBits);
 
-  /// MVT::isExtendedValueType - Test if the given ValueType is extended
+  /// MVT::isExtendedVT - Test if the given ValueType is extended
   /// (as opposed to being simple).
   /// (as opposed to being simple).
-  static inline bool isExtendedValueType(ValueType VT) {
+  static inline bool isExtendedVT(ValueType VT) {
     return VT > SimpleTypeMask;
   }
 
     return VT > SimpleTypeMask;
   }
 
@@ -117,7 +117,7 @@ namespace MVT {  // MVT = Machine Value Types
   /// MVT::isVector - Return true if this is a vector value type.
   static inline bool isVector(ValueType VT) {
     return (VT >= FIRST_VECTOR_VALUETYPE && VT <= LAST_VECTOR_VALUETYPE) ||
   /// MVT::isVector - Return true if this is a vector value type.
   static inline bool isVector(ValueType VT) {
     return (VT >= FIRST_VECTOR_VALUETYPE && VT <= LAST_VECTOR_VALUETYPE) ||
-           isExtendedValueType(VT);
+           isExtendedVT(VT);
   }
   
   /// MVT::getVectorElementType - Given a vector type, return the type of
   }
   
   /// MVT::getVectorElementType - Given a vector type, return the type of
@@ -125,7 +125,7 @@ namespace MVT {  // MVT = Machine Value Types
   static inline ValueType getVectorElementType(ValueType VT) {
     switch (VT) {
     default:
   static inline ValueType getVectorElementType(ValueType VT) {
     switch (VT) {
     default:
-      if (isExtendedValueType(VT))
+      if (isExtendedVT(VT))
         return VT & SimpleTypeMask;
       assert(0 && "Invalid vector type!");
     case v8i8 :
         return VT & SimpleTypeMask;
       assert(0 && "Invalid vector type!");
     case v8i8 :
@@ -147,7 +147,7 @@ namespace MVT {  // MVT = Machine Value Types
   static inline unsigned getVectorNumElements(ValueType VT) {
     switch (VT) {
     default:
   static inline unsigned getVectorNumElements(ValueType VT) {
     switch (VT) {
     default:
-      if (isExtendedValueType(VT))
+      if (isExtendedVT(VT))
         return ((VT & ~SimpleTypeMask) >> SimpleTypeBits) - 1;
       assert(0 && "Invalid vector type!");
     case v16i8: return 16;
         return ((VT & ~SimpleTypeMask) >> SimpleTypeBits) - 1;
       assert(0 && "Invalid vector type!");
     case v16i8: return 16;
@@ -170,7 +170,7 @@ namespace MVT {  // MVT = Machine Value Types
   static inline unsigned getSizeInBits(ValueType VT) {
     switch (VT) {
     default:
   static inline unsigned getSizeInBits(ValueType VT) {
     switch (VT) {
     default:
-      if (isExtendedValueType(VT))
+      if (isExtendedVT(VT))
         return getSizeInBits(getVectorElementType(VT)) *
                getVectorNumElements(VT);
       assert(0 && "ValueType has no known size!");
         return getSizeInBits(getVectorElementType(VT)) *
                getVectorNumElements(VT);
       assert(0 && "ValueType has no known size!");
index 085387faa07e2f6dced7f278b238b654afa6d155..1966a43529425af31d6dd799d4e91035c356f6a6 100644 (file)
@@ -120,7 +120,7 @@ public:
   /// getRegClassFor - Return the register class that should be used for the
   /// specified value type.  This may only be called on legal types.
   TargetRegisterClass *getRegClassFor(MVT::ValueType VT) const {
   /// getRegClassFor - Return the register class that should be used for the
   /// specified value type.  This may only be called on legal types.
   TargetRegisterClass *getRegClassFor(MVT::ValueType VT) const {
-    assert(!MVT::isExtendedValueType(VT));
+    assert(!MVT::isExtendedVT(VT));
     TargetRegisterClass *RC = RegClassForVT[VT];
     assert(RC && "This value type is not natively supported!");
     return RC;
     TargetRegisterClass *RC = RegClassForVT[VT];
     assert(RC && "This value type is not natively supported!");
     return RC;
@@ -130,7 +130,7 @@ public:
   /// specified value type.  This means that it has a register that directly
   /// holds it without promotions or expansions.
   bool isTypeLegal(MVT::ValueType VT) const {
   /// specified value type.  This means that it has a register that directly
   /// holds it without promotions or expansions.
   bool isTypeLegal(MVT::ValueType VT) const {
-    return !MVT::isExtendedValueType(VT) && RegClassForVT[VT] != 0;
+    return !MVT::isExtendedVT(VT) && RegClassForVT[VT] != 0;
   }
 
   class ValueTypeActionImpl {
   }
 
   class ValueTypeActionImpl {
@@ -148,11 +148,11 @@ public:
     }
     
     LegalizeAction getTypeAction(MVT::ValueType VT) const {
     }
     
     LegalizeAction getTypeAction(MVT::ValueType VT) const {
-      if (MVT::isExtendedValueType(VT)) return Expand;
+      if (MVT::isExtendedVT(VT)) return Expand;
       return (LegalizeAction)((ValueTypeActions[VT>>4] >> ((2*VT) & 31)) & 3);
     }
     void setTypeAction(MVT::ValueType VT, LegalizeAction Action) {
       return (LegalizeAction)((ValueTypeActions[VT>>4] >> ((2*VT) & 31)) & 3);
     }
     void setTypeAction(MVT::ValueType VT, LegalizeAction Action) {
-      assert(!MVT::isExtendedValueType(VT));
+      assert(!MVT::isExtendedVT(VT));
       assert(unsigned(VT >> 4) < 
              sizeof(ValueTypeActions)/sizeof(ValueTypeActions[0]));
       ValueTypeActions[VT>>4] |= Action << ((VT*2) & 31);
       assert(unsigned(VT >> 4) < 
              sizeof(ValueTypeActions)/sizeof(ValueTypeActions[0]));
       ValueTypeActions[VT>>4] |= Action << ((VT*2) & 31);
@@ -178,7 +178,7 @@ public:
   /// to get to the smaller register. For illegal floating point types, this
   /// returns the integer type to transform to.
   MVT::ValueType getTypeToTransformTo(MVT::ValueType VT) const {
   /// to get to the smaller register. For illegal floating point types, this
   /// returns the integer type to transform to.
   MVT::ValueType getTypeToTransformTo(MVT::ValueType VT) const {
-    if (MVT::isExtendedValueType(VT))
+    if (MVT::isExtendedVT(VT))
       return MVT::getVectorType(MVT::getVectorElementType(VT),
                                 MVT::getVectorNumElements(VT) / 2);
 
       return MVT::getVectorType(MVT::getVectorElementType(VT),
                                 MVT::getVectorNumElements(VT) / 2);
 
@@ -190,7 +190,7 @@ public:
   /// that are larger than the largest integer register or illegal floating
   /// point types), this returns the largest legal type it will be expanded to.
   MVT::ValueType getTypeToExpandTo(MVT::ValueType VT) const {
   /// that are larger than the largest integer register or illegal floating
   /// point types), this returns the largest legal type it will be expanded to.
   MVT::ValueType getTypeToExpandTo(MVT::ValueType VT) const {
-    assert(!MVT::isExtendedValueType(VT));
+    assert(!MVT::isExtendedVT(VT));
     while (true) {
       switch (getTypeAction(VT)) {
       case Legal:
     while (true) {
       switch (getTypeAction(VT)) {
       case Legal:
@@ -250,7 +250,7 @@ public:
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getOperationAction(unsigned Op, MVT::ValueType VT) const {
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getOperationAction(unsigned Op, MVT::ValueType VT) const {
-    if (MVT::isExtendedValueType(VT)) return Expand;
+    if (MVT::isExtendedVT(VT)) return Expand;
     return (LegalizeAction)((OpActions[Op] >> (2*VT)) & 3);
   }
   
     return (LegalizeAction)((OpActions[Op] >> (2*VT)) & 3);
   }
   
@@ -266,7 +266,7 @@ public:
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getLoadXAction(unsigned LType, MVT::ValueType VT) const {
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getLoadXAction(unsigned LType, MVT::ValueType VT) const {
-    if (MVT::isExtendedValueType(VT)) return Expand;
+    if (MVT::isExtendedVT(VT)) return Expand;
     return (LegalizeAction)((LoadXActions[LType] >> (2*VT)) & 3);
   }
   
     return (LegalizeAction)((LoadXActions[LType] >> (2*VT)) & 3);
   }
   
@@ -282,7 +282,7 @@ public:
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getStoreXAction(MVT::ValueType VT) const {
   /// expanded to some other code sequence, or the target has a custom expander
   /// for it.
   LegalizeAction getStoreXAction(MVT::ValueType VT) const {
-    if (MVT::isExtendedValueType(VT)) return Expand;
+    if (MVT::isExtendedVT(VT)) return Expand;
     return (LegalizeAction)((StoreXActions >> (2*VT)) & 3);
   }
   
     return (LegalizeAction)((StoreXActions >> (2*VT)) & 3);
   }
   
@@ -298,7 +298,7 @@ public:
   /// for it.
   LegalizeAction
   getIndexedLoadAction(unsigned IdxMode, MVT::ValueType VT) const {
   /// for it.
   LegalizeAction
   getIndexedLoadAction(unsigned IdxMode, MVT::ValueType VT) const {
-    if (MVT::isExtendedValueType(VT)) return Expand;
+    if (MVT::isExtendedVT(VT)) return Expand;
     return (LegalizeAction)((IndexedModeActions[0][IdxMode] >> (2*VT)) & 3);
   }
 
     return (LegalizeAction)((IndexedModeActions[0][IdxMode] >> (2*VT)) & 3);
   }
 
@@ -315,7 +315,7 @@ public:
   /// for it.
   LegalizeAction
   getIndexedStoreAction(unsigned IdxMode, MVT::ValueType VT) const {
   /// for it.
   LegalizeAction
   getIndexedStoreAction(unsigned IdxMode, MVT::ValueType VT) const {
-    if (MVT::isExtendedValueType(VT)) return Expand;
+    if (MVT::isExtendedVT(VT)) return Expand;
     return (LegalizeAction)((IndexedModeActions[1][IdxMode] >> (2*VT)) & 3);
   }  
   
     return (LegalizeAction)((IndexedModeActions[1][IdxMode] >> (2*VT)) & 3);
   }  
   
@@ -365,7 +365,7 @@ public:
   /// registers, but may be more than one for types (like i64) that are split
   /// into pieces.
   unsigned getNumRegisters(MVT::ValueType VT) const {
   /// registers, but may be more than one for types (like i64) that are split
   /// into pieces.
   unsigned getNumRegisters(MVT::ValueType VT) const {
-    if (!MVT::isExtendedValueType(VT))
+    if (!MVT::isExtendedVT(VT))
       return NumRegistersForVT[VT];
            
     MVT::ValueType VT1, VT2;
       return NumRegistersForVT[VT];
            
     MVT::ValueType VT1, VT2;
@@ -665,7 +665,7 @@ protected:
   /// regclass for the specified value type.  This indicates the selector can
   /// handle values of that class natively.
   void addRegisterClass(MVT::ValueType VT, TargetRegisterClass *RC) {
   /// regclass for the specified value type.  This indicates the selector can
   /// handle values of that class natively.
   void addRegisterClass(MVT::ValueType VT, TargetRegisterClass *RC) {
-    assert(!MVT::isExtendedValueType(VT));
+    assert(!MVT::isExtendedVT(VT));
     AvailableRegClasses.push_back(std::make_pair(VT, RC));
     RegClassForVT[VT] = RC;
   }
     AvailableRegClasses.push_back(std::make_pair(VT, RC));
     RegClassForVT[VT] = RC;
   }
index bc94a624f0f4060cf3cceca64f3988a19b906d23..a239aef16c0d5b20098cb9faf0cf0fe56847fd35 100644 (file)
@@ -1714,7 +1714,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
           break;
         case Expand: {
           SDOperand Lo, Hi;
           break;
         case Expand: {
           SDOperand Lo, Hi;
-          assert(!MVT::isExtendedValueType(Node->getOperand(i).getValueType())&&
+          assert(!MVT::isExtendedVT(Node->getOperand(i).getValueType()) &&
                  "FIXME: TODO: implement returning non-legal vector types!");
           ExpandOp(Node->getOperand(i), Lo, Hi);
           NewValues.push_back(Lo);
                  "FIXME: TODO: implement returning non-legal vector types!");
           ExpandOp(Node->getOperand(i), Lo, Hi);
           NewValues.push_back(Lo);
index 5780eff67a7c5e9eb047cd8c2595526d36b5dcfa..6dcba0d9d6b4cfa43d9e8191888634aa2e348c7e 100644 (file)
@@ -2475,7 +2475,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList,
 }
 
 SDVTList SelectionDAG::getVTList(MVT::ValueType VT) {
 }
 
 SDVTList SelectionDAG::getVTList(MVT::ValueType VT) {
-  if (!MVT::isExtendedValueType(VT))
+  if (!MVT::isExtendedVT(VT))
     return makeVTList(SDNode::getValueTypeList(VT), 1);
 
   for (std::list<std::vector<MVT::ValueType> >::iterator I = VTList.begin(),
     return makeVTList(SDNode::getValueTypeList(VT), 1);
 
   for (std::list<std::vector<MVT::ValueType> >::iterator I = VTList.begin(),
index 7472f888e167f54fabef0f1994c4e679f5d14692..0518aa20d7746bb15d22be2bb4ae8ba0949b5a27 100644 (file)
@@ -22,7 +22,7 @@ using namespace llvm;
 std::string MVT::getValueTypeString(MVT::ValueType VT) {
   switch (VT) {
   default:
 std::string MVT::getValueTypeString(MVT::ValueType VT) {
   switch (VT) {
   default:
-    if (isExtendedValueType(VT))
+    if (isExtendedVT(VT))
       return "v" + utostr(getVectorNumElements(VT)) +
              getValueTypeString(getVectorElementType(VT));
     assert(0 && "Invalid ValueType!");
       return "v" + utostr(getVectorNumElements(VT)) +
              getValueTypeString(getVectorElementType(VT));
     assert(0 && "Invalid ValueType!");
@@ -59,7 +59,7 @@ std::string MVT::getValueTypeString(MVT::ValueType VT) {
 const Type *MVT::getTypeForValueType(MVT::ValueType VT) {
   switch (VT) {
   default:
 const Type *MVT::getTypeForValueType(MVT::ValueType VT) {
   switch (VT) {
   default:
-    if (isExtendedValueType(VT))
+    if (isExtendedVT(VT))
       return VectorType::get(getTypeForValueType(getVectorElementType(VT)),
                              getVectorNumElements(VT));
     assert(0 && "ValueType does not correspond to LLVM type!");
       return VectorType::get(getTypeForValueType(getVectorElementType(VT)),
                              getVectorNumElements(VT));
     assert(0 && "ValueType does not correspond to LLVM type!");