[PATCH] D139882: [NFC][MC] `MCInst`: `Operands` small size optimization: store 16, not 8, inline `MCOperand`

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 14:08:53 PST 2022


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, craig.topper, grosbach.
lebedev.ri added a project: LLVM.
Herald added subscribers: StephenFan, mstojanovic.
Herald added a project: All.
lebedev.ri requested review of this revision.
Herald added a subscriber: courbet.

This improves the torture test of

  ./bin/llvm-exegesis -mcpu=znver3 -mode=inverse_throughput --opcode-index=-1 --benchmarks-file=/dev/null --dump-object-to-disk=0 --measurements-print-progress --skip-measurements

from 2m17s to 2min14s, and has the following effect on memory:

  heaptrack stats:
  allocations:100809844 -> 77342110 (-23%)
  leaked allocations: 1128
  temporary allocations:  24911145  -> 1576268  (-93.7%) !!!

... at the cost of slightly higher peak RSS and peak heap memory consumption:

I'm not sure who is the code owner of this component.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139882

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


Index: llvm/include/llvm/MC/MCInst.h
===================================================================
--- llvm/include/llvm/MC/MCInst.h
+++ llvm/include/llvm/MC/MCInst.h
@@ -189,7 +189,7 @@
   unsigned Flags = 0;
 
   SMLoc Loc;
-  SmallVector<MCOperand, 8> Operands;
+  SmallVector<MCOperand, 16> Operands;
 
 public:
   MCInst() = default;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139882.482262.patch
Type: text/x-patch
Size: 345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221212/a40af96f/attachment.bin>


More information about the llvm-commits mailing list