From 8e012f5f22a0c4b9d95216f932a4c3ee5075c165 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 9 Feb 2012 11:25:09 +0000 Subject: [PATCH] Move the Name field in MCInstrDesc to the end, saving 8 bytes of padding per entry on x86_64. No change on i386. llvm-svn: 150170 --- llvm/include/llvm/MC/MCInstrDesc.h | 2 +- llvm/utils/TableGen/InstrInfoEmitter.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/MC/MCInstrDesc.h b/llvm/include/llvm/MC/MCInstrDesc.h index 6d71cf570aec..3fe5643369e7 100644 --- a/llvm/include/llvm/MC/MCInstrDesc.h +++ b/llvm/include/llvm/MC/MCInstrDesc.h @@ -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. diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp index 89abb8446151..46c9f86c17f8 100644 --- a/llvm/utils/TableGen/InstrInfoEmitter.cpp +++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp @@ -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<second; + OS << ", \"" << Inst.TheDef->getName() << '"'; + OS << " }, // Inst #" << Num << " = " << Inst.TheDef->getName() << "\n"; }