[llvm] 1668685 - [MC] Reorder MCInst fields to make sizeof(MCInst) smaller

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 14:55:56 PST 2019


Author: Fangrui Song
Date: 2019-11-22T14:55:43-08:00
New Revision: 1668685118cd509d85e5242fa5742bccb3a4aba7

URL: https://github.com/llvm/llvm-project/commit/1668685118cd509d85e5242fa5742bccb3a4aba7
DIFF: https://github.com/llvm/llvm-project/commit/1668685118cd509d85e5242fa5742bccb3a4aba7.diff

LOG: [MC] Reorder MCInst fields to make sizeof(MCInst) smaller

sizeof(MCInst) is decreased from 168 to 160 on 64-bit systems.

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCInst.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCInst.h b/llvm/include/llvm/MC/MCInst.h
index 8df8096bba94..360dbda58fcb 100644
--- a/llvm/include/llvm/MC/MCInst.h
+++ b/llvm/include/llvm/MC/MCInst.h
@@ -157,13 +157,14 @@ class MCOperand {
 /// instruction.
 class MCInst {
   unsigned Opcode = 0;
-  SMLoc Loc;
-  SmallVector<MCOperand, 8> Operands;
   // These flags could be used to pass some info from one target subcomponent
   // to another, for example, from disassembler to asm printer. The values of
   // the flags have any sense on target level only (e.g. prefixes on x86).
   unsigned Flags = 0;
 
+  SMLoc Loc;
+  SmallVector<MCOperand, 8> Operands;
+
 public:
   MCInst() = default;
 


        


More information about the llvm-commits mailing list