[PATCH] D17028: [ThinLTO] Use MD5 hash in function index.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 07:06:06 PST 2016


tejohnson created this revision.
tejohnson added reviewers: davidxl, joker.eph.
tejohnson added a subscriber: llvm-commits.
Herald added a subscriber: joker.eph.

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.

http://reviews.llvm.org/D17028

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  include/llvm/IR/Function.h
  include/llvm/IR/FunctionInfo.h
  include/llvm/IR/Module.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/IR/FunctionInfo.cpp
  lib/IR/Module.cpp
  lib/Transforms/IPO/FunctionImport.cpp
  test/tools/gold/X86/thinlto.ll
  test/tools/llvm-lto/thinlto.ll
  tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17028.47317.patch
Type: text/x-patch
Size: 22330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160209/068f067e/attachment.bin>


More information about the llvm-commits mailing list