From 52b89dd303424582d054e18417099f3a7e343b41 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 5 Mar 2012 08:33:33 +0000 Subject: [PATCH] Shrink and reorder fields in MCRegisterClass to reduce size of static data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152019 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCRegisterInfo.h | 12 ++++++------ utils/TableGen/RegisterInfoEmitter.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h index 2d9a4594c66..ddf355e4b49 100644 --- a/include/llvm/MC/MCRegisterInfo.h +++ b/include/llvm/MC/MCRegisterInfo.h @@ -28,15 +28,15 @@ public: 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. /// diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp index e01473bb60c..c949a25e38a 100644 --- a/utils/TableGen/RegisterInfoEmitter.cpp +++ b/utils/TableGen/RegisterInfoEmitter.cpp @@ -399,14 +399,14 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target, 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";