[PATCH] D17212: [ThinLTO] Support for call graph in per-module and combined summary.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 13:22:00 PST 2016


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

This patch adds support for including call graph edges in the function
summary. Only inter-module calls are recorded. For the per-module
summary this includes all calls to external functions. In the combined
summary, only edges to functions with summaries in the index are included.

The call graph edges can be used to make importing decisions without
materializing any source modules, and can be used in the plugin to make
file staging decisions for distributed build systems, and is expected to
have other uses.

The call graph edges are recorded in the bitcode via a list of
CalleeValueIds when no PGO data exists, or <CalleeValueId, ProfileCount>
pairs when there is PGO, where the ValueId can be mapped to the function
GUID via the ValueSymbolTable. In the function index in memory,
the call graph edges are saved using <CalleeGUID, ProfileCount>
pairs, where ProfileCount is 0 when there is no PGO data, for easier
lookup of the associated callee summary via the GUID.

Measurements on 483.xalancbmk show the following increases in object and
combined index sizes:
- Overall .o bitcode increase is 0.25% without PGO and 0.4% with PGO
- The combined index increase is 21/22% without/with PGO (for
  comparison, these are both still reduced 62% over the old summary
  format without MD5).

http://reviews.llvm.org/D17212

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  include/llvm/IR/FunctionInfo.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/Bitcode/Writer/LLVMBuild.txt
  test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo.ll
  test/Bitcode/Inputs/thinlto-function-summary-callgraph.ll
  test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
  test/Bitcode/thinlto-function-summary-callgraph.ll
  test/Bitcode/thinlto-function-summary.ll
  test/Bitcode/thinlto-summary-linkage-types.ll
  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: D17212.47847.patch
Type: text/x-patch
Size: 50665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160212/310c7169/attachment.bin>


More information about the llvm-commits mailing list