[llvm-commits] [llvm] r150170 - in /llvm/trunk: include/llvm/MC/MCInstrDesc.h utils/TableGen/InstrInfoEmitter.cpp

Benjamin Kramer benny.kra at googlemail.com
Thu Feb 9 03:25:09 PST 2012


Author: d0k
Date: Thu Feb  9 05:25:09 2012
New Revision: 150170

URL: http://llvm.org/viewvc/llvm-project?rev=150170&view=rev
Log:
Move the Name field in MCInstrDesc to the end, saving 8 bytes of padding per entry on x86_64.

No change on i386.

Modified:
    llvm/trunk/include/llvm/MC/MCInstrDesc.h
    llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp

Modified: llvm/trunk/include/llvm/MC/MCInstrDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCInstrDesc.h?rev=150170&r1=150169&r2=150170&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCInstrDesc.h (original)
+++ llvm/trunk/include/llvm/MC/MCInstrDesc.h Thu Feb  9 05:25:09 2012
@@ -137,12 +137,12 @@
   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.

Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=150170&r1=150169&r2=150170&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Thu Feb  9 05:25:09 2012
@@ -264,8 +264,7 @@
   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 @@
   else
     OS << "OperandInfo" << OpInfo.find(OperandInfo)->second;
 
+  OS << ", \"" << Inst.TheDef->getName() << '"';
+
   OS << " },  // Inst #" << Num << " = " << Inst.TheDef->getName() << "\n";
 }
 





More information about the llvm-commits mailing list