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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 14:04:18 PST 2016


tejohnson updated this revision to Diff 49994.
tejohnson added a comment.

Update patch to include full reference graph.

Some notable changes from prior patch:

- include non-call reference edges in summary records
- introduce summary entries for global variable initializations
- add the VSTOFFSET record to the combined index bitcode file, and use it when reading both the per-module and combined indices to parse the VST before the summary section (analogous to how it is used when parsing normal bitcode to parse the VST before the function blocks), which reduces the amount of bookkeeping required to associate the VST entry with the value ids used in the summary section.

Bitcode name changes:

- add a new FS_*_GLOBALVAR_INIT_REFS records to hold ref graph edges from global variable inits to referenced global vars.
- changed the VST_CODE_COMBINED_FNENTRY name to VST_CODE_COMBINED_GVDEFENTRY to reflect the broadened scope (can correspond to either a function or variable def and associated summary).
- changed FUNCTION_SUMMARY_BLOCK_ID to GLOBALVAL_SUMMARY_BLOCK_ID to reflect additional scope

Data structure and related naming changes:

- Added a new GlobalValueSummary type which holds summary info common to both the function and globalvar summaries.
- Made the existing FunctionSummary record a derived class of the new GlobalValueSummary.
- Added a new derived GlobalVarSummary class of GlobalValueSummary.
- Renamed FunctionInfo* -> GlobalValueInfo*
- Renamed FunctionSummary -> GlobalValueSummary or just Summary as appropriate
- Misc other variable and method renamings to reflect above changes.

TODO:

- Rename FunctionInfoIndex to something more broad (ModuleIndex?) (ditto for related classes like FunctionInfoIndexBitcodeReader).
- Move getGUID and getGlobalIdentifier from Function to GlobalValue class.
- Some lingering FunctionSummary references that need to be updated to GlobalValueSummary or just Summary.

I will work on the TODO items now but wanted to get this patch out for review,
testing by Mehdi, and feedback.

Note that some of these changes (many of the renames, can be committed first
as NFC changes).


http://reviews.llvm.org/D17212

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  include/llvm/Bitcode/ReaderWriter.h
  include/llvm/IR/FunctionInfo.h
  include/llvm/Object/FunctionIndexObjectFile.h
  include/llvm/ProfileData/ProfileCommon.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/Bitcode/Writer/LLVMBuild.txt
  lib/IR/FunctionInfo.cpp
  lib/Object/FunctionIndexObjectFile.cpp
  lib/Transforms/IPO/FunctionImport.cpp
  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/gold/gold-plugin.cpp
  tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
  tools/llvm-lto/llvm-lto.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17212.49994.patch
Type: text/x-patch
Size: 101986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160307/d8bca016/attachment.bin>


More information about the llvm-commits mailing list