[PATCH] D77939: [MC] Use subclass data for MCExpr to reduce memory usage

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 03:42:39 PDT 2020


nikic created this revision.
Herald added subscribers: llvm-commits, dexonsmith.
Herald added a project: LLVM.
nikic added reviewers: MaskRay, jsji.
nikic added a comment.

I find it hard to determine who should review this, seems like all the major contributors to this code are no longer active (including the code owner of the MC layer...)


MCExpr has a bunch of free space that is currently going to waste. Repurpose it as 24 bits of subclass data, which is enough to reduce the size of all subclasses by 8 bytes. This gives us some respectable savings for debuginfo builds. Here are the max-rss reductions for the fat LTO link step (full data <http://llvm-compile-time-tracker.com/compare.php?from=226fd5ed5546baf3771ce1ad9f9e8ab09bb67808&to=19c7787afb3f4082d9435c085c742d917837ff98&stat=max-rss&details=on>):

  kc.link 		238MiB 	231MiB (-2.82%)
  sqlite3.link 		258MiB 	250MiB (-3.27%)
  consumer-typeset.link 	152MiB 	148MiB (-2.51%)
  bullet.link 		197MiB 	192MiB (-2.30%)
  tramp3d-v4.link 	578MiB 	567MiB (-1.92%)
  pairlocalalign.link 	92MiB 	 90MiB (-1.98%)
  clamscan.link 		230MiB 	223MiB (-2.81%)
  lencod.link 		242MiB 	235MiB (-2.67%)
  SPASS.link 		235MiB 	230MiB (-2.23%)
  7zip-benchmark.link 	450MiB 	435MiB (-3.25%)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77939

Files:
  include/llvm/MC/MCExpr.h
  lib/MC/MCExpr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77939.256759.patch
Type: text/x-patch
Size: 6931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200411/0a9cf1fa/attachment.bin>


More information about the llvm-commits mailing list