[PATCH] D34694: llvm-profdata: Indirect infrequently used fields to reduce memory usage

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 08:41:07 PDT 2017


dblaikie created this revision.

Examining a large profile example, it seems relatively few records have
non-empty IndirectCall and MemOP data, so indirecting these through a
unique_ptr (non-null only when they are non-empty) Reduces memory usage
on this particular example from 14GB to 10GB according to valgrind's
massif.

I suspect it'd still be worth moving InstrProfWriter to its own data
structure that had Counts and the indirected IndirectCall+MemOP, and did
not include the Name, Hash, or Error fields. This would reduce the size
of this dominant data structure by half of this new, lower amount.
(Name(2), Hash(1), Error(1) ~= Counts(vector, 3), ValueProfData
(unique_ptr, 1))


https://reviews.llvm.org/D34694

Files:
  include/llvm/ProfileData/InstrProf.h
  lib/ProfileData/InstrProf.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34694.104182.patch
Type: text/x-patch
Size: 3629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/1c9e17fe/attachment.bin>


More information about the llvm-commits mailing list