[llvm-commits] [llvm] r152019 - in /llvm/trunk: include/llvm/MC/MCRegisterInfo.h utils/TableGen/RegisterInfoEmitter.cpp

Craig Topper craig.topper at gmail.com
Mon Mar 5 00:33:33 PST 2012


Author: ctopper
Date: Mon Mar  5 02:33:33 2012
New Revision: 152019

URL: http://llvm.org/viewvc/llvm-project?rev=152019&view=rev
Log:
Shrink and reorder fields in MCRegisterClass to reduce size of static data.

Modified:
    llvm/trunk/include/llvm/MC/MCRegisterInfo.h
    llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp

Modified: llvm/trunk/include/llvm/MC/MCRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCRegisterInfo.h?rev=152019&r1=152018&r2=152019&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCRegisterInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCRegisterInfo.h Mon Mar  5 02:33:33 2012
@@ -28,15 +28,15 @@
   typedef const uint16_t* iterator;
   typedef const uint16_t* const_iterator;
 
-  const unsigned ID;
   const char *Name;
-  const unsigned RegSize, Alignment; // Size & Alignment of register in bytes
-  const int CopyCost;
-  const bool Allocatable;
   const iterator RegsBegin;
   const uint8_t *const RegSet;
-  const unsigned RegsSize;
-  const unsigned RegSetSize;
+  const uint8_t RegsSize;
+  const uint8_t RegSetSize;
+  const uint8_t ID;
+  const uint8_t RegSize, Alignment; // Size & Alignment of register in bytes
+  const int8_t CopyCost;
+  const bool Allocatable;
 
   /// getID() - Return the register class ID number.
   ///

Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=152019&r1=152018&r2=152019&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Mon Mar  5 02:33:33 2012
@@ -399,14 +399,14 @@
 
   for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
     const CodeGenRegisterClass &RC = *RegisterClasses[rc];
-    OS << "  { " << RC.getQualifiedName() + "RegClassID" << ", "
-       << '\"' << RC.getName() << "\", "
+    OS << "  { " << '\"' << RC.getName() << "\", "
+       << RC.getName() << ", " << RC.getName() << "Bits, "
+       << RC.getOrder().size() << ", sizeof(" << RC.getName() << "Bits), "
+       << RC.getQualifiedName() + "RegClassID" << ", "
        << RC.SpillSize/8 << ", "
        << RC.SpillAlignment/8 << ", "
        << RC.CopyCost << ", "
-       << RC.Allocatable << ", "
-       << RC.getName() << ", " << RC.getName() << "Bits, "
-       << RC.getOrder().size() << ", sizeof(" << RC.getName() << "Bits) },\n";
+       << RC.Allocatable << " },\n";
   }
 
   OS << "};\n\n";





More information about the llvm-commits mailing list