summaryrefslogtreecommitdiff
path: root/tools/llvm-bcanalyzer
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-02-10 18:57:54 +0000
committerTeresa Johnson <tejohnson@google.com>2016-02-10 18:57:54 +0000
commitf38049c5010a20c11dc66241c309721630f60317 (patch)
treefaf0df0f07d1bd654dcc7e6b8730f39d5d87ef10 /tools/llvm-bcanalyzer
parent94873e8e3bb26acc78805bdeb46683dad1d6e41a (diff)
[ThinLTO] Use MD5 hash in function index.
Summary: This patch uses the lower 64-bits of the MD5 hash of a function name as a GUID in the function index, instead of storing function names. Any local functions are first given a global name by prepending the original source file name. This is the same naming scheme and GUID used by PGO in the indexed profile format. This change has a couple of benefits. The primary benefit is size reduction in the combined index file, for example 483.xalancbmk's combined index file was reduced by around 70%. It should also result in memory savings for the index file in memory, as the in-memory map is also indexed by the hash instead of the string. Second, this enables integration with indirect call promotion, since the indirect call profile targets are recorded using the same global naming convention and hash. This will enable the function importer to easily locate function summaries for indirect call profile targets to enable their import and subsequent promotion. The original source file name is recorded in the bitcode in a new module-level record for use in the ThinLTO backend pipeline. Reviewers: davidxl, joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D17028 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-bcanalyzer')
-rw-r--r--tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
index 1a4bc9ef178..1e0209bb79a 100644
--- a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -173,6 +173,7 @@ static const char *GetCodeName(unsigned CodeID, unsigned BlockID,
STRINGIFY_CODE(MODULE_CODE, GCNAME)
STRINGIFY_CODE(MODULE_CODE, VSTOFFSET)
STRINGIFY_CODE(MODULE_CODE, METADATA_VALUES)
+ STRINGIFY_CODE(MODULE_CODE, SOURCE_FILENAME)
}
case bitc::IDENTIFICATION_BLOCK_ID:
switch (CodeID) {