[MI] Reduce MachineInstr size (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 15 Apr 2020 20:40:08 +0000 (22:40 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 17 Apr 2020 16:30:56 +0000 (18:30 +0200)
Move CapOperands next to AsmPrinterFlags, to reduce size of
MachineInstr by 8 bytes.

llvm/include/llvm/CodeGen/MachineInstr.h

index 6c550dc..48db14e 100644 (file)
@@ -115,8 +115,6 @@ private:
   // Operands are allocated by an ArrayRecycler.
   MachineOperand *Operands = nullptr;   // Pointer to the first operand.
   unsigned NumOperands = 0;             // Number of operands on instruction.
-  using OperandCapacity = ArrayRecycler<MachineOperand>::Capacity;
-  OperandCapacity CapOperands;          // Capacity of the Operands array.
 
   uint16_t Flags = 0;                   // Various bits of additional
                                         // information about machine
@@ -129,6 +127,11 @@ private:
                                         // anything other than to convey comment
                                         // information to AsmPrinter.
 
+  // OperandCapacity has uint8_t size, so it should be next to AsmPrinterFlags
+  // to properly pack.
+  using OperandCapacity = ArrayRecycler<MachineOperand>::Capacity;
+  OperandCapacity CapOperands;          // Capacity of the Operands array.
+
   /// Internal implementation detail class that provides out-of-line storage for
   /// extra info used by the machine instruction when this info cannot be stored
   /// in-line within the instruction itself.