SamplePGO - Reduce memory utilization by 10x.
authorDiego Novillo <dnovillo@google.com>
Fri, 11 Dec 2015 23:21:38 +0000 (23:21 +0000)
committerDiego Novillo <dnovillo@google.com>
Fri, 11 Dec 2015 23:21:38 +0000 (23:21 +0000)
commit31b250abad3b61969ceb4000bf735339b1cc54dc
tree7d9edcfa2356b79474a07c98ddf402207e2fcbcb
parentbe6eaee35a261d33f0db2094517fe242bda9db48
SamplePGO - Reduce memory utilization by 10x.

DenseMap is the wrong data structure to use for sample records and call
sites.  The keys are too large, causing massive core memory growth when
reading profiles.

Before this patch, a 21Mb input profile was causing the compiler to grow
to 3Gb in memory.  By switching to std::map, the compiler now grows to
300Mb in memory.

There still are some opportunities for memory footprint reduction. I'll
be looking at those next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255389 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/SampleProf.h
include/llvm/ProfileData/SampleProfReader.h
lib/Transforms/IPO/SampleProfile.cpp