Move the Name field in MCInstrDesc to the end, saving 8 bytes of padding per entry...
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 9 Feb 2012 11:25:09 +0000 (11:25 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 9 Feb 2012 11:25:09 +0000 (11:25 +0000)
No change on i386.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150170 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCInstrDesc.h
utils/TableGen/InstrInfoEmitter.cpp

index 6d71cf570aecd0a1ee0890b4e8323115906c8292..3fe5643369e7620a0289c6008f70824ea326f896 100644 (file)
@@ -137,12 +137,12 @@ public:
   unsigned short  NumDefs;       // Num of args that are definitions
   unsigned short  SchedClass;    // enum identifying instr sched class
   unsigned short  Size;          // Number of bytes in encoding.
-  const char *    Name;          // Name of the instruction record in td file
   unsigned        Flags;         // Flags identifying machine instr class
   uint64_t        TSFlags;       // Target Specific Flag values
   const unsigned *ImplicitUses;  // Registers implicitly read by this instr
   const unsigned *ImplicitDefs;  // Registers implicitly defined by this instr
   const MCOperandInfo *OpInfo;   // 'NumOperands' entries about operands
+  const char     *Name;          // Name of the instruction record in td file
 
   /// getOperandConstraint - Returns the value of the specific constraint if
   /// it is set. Returns -1 if it is not set.
index 89abb844615141e22440a313eb56c69ba47ad19d..46c9f86c17f881c2f1857a3f8a63363cdba814f0 100644 (file)
@@ -264,8 +264,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
   OS << Num << ",\t" << MinOperands << ",\t"
      << Inst.Operands.NumDefs << ",\t"
      << getItinClassNumber(Inst.TheDef) << ",\t"
-     << Inst.TheDef->getValueAsInt("Size") << ",\t\""
-     << Inst.TheDef->getName() << "\", 0";
+     << Inst.TheDef->getValueAsInt("Size") << ",\t0";
 
   // Emit all of the target indepedent flags...
   if (Inst.isPseudo)           OS << "|(1<<MCID::Pseudo)";
@@ -330,6 +329,8 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
   else
     OS << "OperandInfo" << OpInfo.find(OperandInfo)->second;
 
+  OS << ", \"" << Inst.TheDef->getName() << '"';
+
   OS << " },  // Inst #" << Num << " = " << Inst.TheDef->getName() << "\n";
 }