[llvm] r266562 - Declare MVT::SimpleValueType as an int8_t sized enum. This removes 400 bytes from TargetLoweringBase and probably other places.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 17 10:37:33 PDT 2016


Author: ctopper
Date: Sun Apr 17 12:37:33 2016
New Revision: 266562

URL: http://llvm.org/viewvc/llvm-project?rev=266562&view=rev
Log:
Declare MVT::SimpleValueType as an int8_t sized enum. This removes 400 bytes from TargetLoweringBase and probably other places.

This required changing several places to print VT enums as strings instead of raw ints since the proper method to use to print became ambiguous. This is probably an improvement anyway.

This also appears to save ~8K from an x86 self host build of llc.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineValueType.h
    llvm/trunk/include/llvm/CodeGen/ValueTypes.td
    llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp
    llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
    llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
    llvm/trunk/test/TableGen/intrinsic-long-name.td
    llvm/trunk/utils/TableGen/DAGISelMatcher.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineValueType.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineValueType.h?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineValueType.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineValueType.h Sun Apr 17 12:37:33 2016
@@ -28,7 +28,7 @@ namespace llvm {
   /// type can be represented by an MVT.
 class MVT {
   public:
-    enum SimpleValueType {
+    enum SimpleValueType : int8_t {
       // INVALID_SIMPLE_VALUE_TYPE - Simple value types less than zero are
       // considered extended value types.
       INVALID_SIMPLE_VALUE_TYPE = -1,
@@ -142,38 +142,38 @@ class MVT {
       MAX_ALLOWED_VALUETYPE = 96,
 
       // Token - A value of type llvm::TokenTy
-      token          = 249,
+      token          = 120,
 
       // Metadata - This is MDNode or MDString.
-      Metadata       = 250,
+      Metadata       = 121,
 
       // iPTRAny - An int value the size of the pointer of the current
       // target to any address space. This must only be used internal to
       // tblgen. Other than for overloading, we treat iPTRAny the same as iPTR.
-      iPTRAny        = 251,
+      iPTRAny        = 122,
 
       // vAny - A vector with any length and element size. This is used
       // for intrinsics that have overloadings based on vector types.
       // This is only for tblgen's consumption!
-      vAny           = 252,
+      vAny           = 123,
 
       // fAny - Any floating-point or vector floating-point value. This is used
       // for intrinsics that have overloadings based on floating-point types.
       // This is only for tblgen's consumption!
-      fAny           = 253,
+      fAny           = 124,
 
       // iAny - An integer or vector integer value of any bit width. This is
       // used for intrinsics that have overloadings based on integer bit widths.
       // This is only for tblgen's consumption!
-      iAny           = 254,
+      iAny           = 125,
 
       // iPTR - An int value the size of the pointer of the current
       // target.  This should only be used internal to tblgen!
-      iPTR           = 255,
+      iPTR           = 126,
 
       // Any - Any type. This is used for intrinsics that have overloadings.
       // This is only for tblgen's consumption!
-      Any            = 256
+      Any            = 127
     };
 
     SimpleValueType SimpleTy;

Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.td?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.td (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.td Sun Apr 17 12:37:33 2016
@@ -96,24 +96,24 @@ def x86mmx : ValueType<64 , 64>;   // X8
 def FlagVT : ValueType<0  , 65>;   // Pre-RA sched glue
 def isVoid : ValueType<0  , 66>;   // Produces no value
 def untyped: ValueType<8  , 67>;   // Produces an untyped value
-def token  : ValueType<0  , 249>;  // TokenTy
-def MetadataVT: ValueType<0, 250>; // Metadata
+def token  : ValueType<0  , 120>;  // TokenTy
+def MetadataVT: ValueType<0, 121>; // Metadata
 
 // Pseudo valuetype mapped to the current pointer size to any address space.
 // Should only be used in TableGen.
-def iPTRAny   : ValueType<0, 251>;
+def iPTRAny   : ValueType<0, 122>;
 
 // Pseudo valuetype to represent "vector of any size"
-def vAny   : ValueType<0  , 252>;
+def vAny   : ValueType<0  , 123>;
 
 // Pseudo valuetype to represent "float of any format"
-def fAny   : ValueType<0  , 253>;
+def fAny   : ValueType<0  , 124>;
 
 // Pseudo valuetype to represent "integer of any bit width"
-def iAny   : ValueType<0  , 254>;
+def iAny   : ValueType<0  , 125>;
 
 // Pseudo valuetype mapped to the current pointer size.
-def iPTR   : ValueType<0  , 255>;
+def iPTR   : ValueType<0  , 126>;
 
 // Pseudo valuetype to represent "any type of any size".
-def Any    : ValueType<0  , 256>;
+def Any    : ValueType<0  , 127>;

Modified: llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp Sun Apr 17 12:37:33 2016
@@ -175,7 +175,7 @@ SDValue BPFTargetLowering::LowerFormalAr
       switch (RegVT.getSimpleVT().SimpleTy) {
       default: {
         errs() << "LowerFormalArguments Unhandled argument type: "
-               << RegVT.getSimpleVT().SimpleTy << '\n';
+               << RegVT.getEVTString() << '\n';
         llvm_unreachable(0);
       }
       case MVT::i64:

Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Sun Apr 17 12:37:33 2016
@@ -455,7 +455,7 @@ MSP430TargetLowering::LowerCCCArguments(
         {
 #ifndef NDEBUG
           errs() << "LowerFormalArguments Unhandled argument type: "
-               << RegVT.getSimpleVT().SimpleTy << "\n";
+               << RegVT.getEVTString() << "\n";
 #endif
           llvm_unreachable(nullptr);
         }

Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Sun Apr 17 12:37:33 2016
@@ -1332,7 +1332,7 @@ XCoreTargetLowering::LowerCCCArguments(S
         {
 #ifndef NDEBUG
           errs() << "LowerFormalArguments Unhandled argument type: "
-                 << RegVT.getSimpleVT().SimpleTy << "\n";
+                 << RegVT.getEVTString() << "\n";
 #endif
           llvm_unreachable(nullptr);
         }

Modified: llvm/trunk/test/TableGen/intrinsic-long-name.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/intrinsic-long-name.td?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/test/TableGen/intrinsic-long-name.td (original)
+++ llvm/trunk/test/TableGen/intrinsic-long-name.td Sun Apr 17 12:37:33 2016
@@ -22,7 +22,7 @@ class Intrinsic<string name, list<LLVMTy
   list<IntrinsicProperty> IntrProperties = [];
 }
 
-def iAny : ValueType<0, 254>;
+def iAny : ValueType<0, 125>;
 def llvm_anyint_ty : LLVMType<iAny>;
 
 // Make sure we generate the long name without crashing

Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.cpp?rev=266562&r1=266561&r2=266562&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.cpp Sun Apr 17 12:37:33 2016
@@ -225,12 +225,14 @@ void CheckFoldableChainNodeMatcher::prin
 }
 
 void EmitIntegerMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "EmitInteger " << Val << " VT=" << VT << '\n';
+  OS.indent(indent) << "EmitInteger " << Val << " VT=" << getEnumName(VT)
+                    << '\n';
 }
 
 void EmitStringIntegerMatcher::
 printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "EmitStringInteger " << Val << " VT=" << VT << '\n';
+  OS.indent(indent) << "EmitStringInteger " << Val << " VT=" << getEnumName(VT)
+                    << '\n';
 }
 
 void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
@@ -239,7 +241,7 @@ void EmitRegisterMatcher::printImpl(raw_
     OS << Reg->getName();
   else
     OS << "zero_reg";
-  OS << " VT=" << VT << '\n';
+  OS << " VT=" << getEnumName(VT) << '\n';
 }
 
 void EmitConvertToTargetMatcher::




More information about the llvm-commits mailing list