[ThinLTO] Add summary entries for index-based WPD
authorTeresa Johnson <tejohnson@google.com>
Tue, 2 Jul 2019 19:38:02 +0000 (19:38 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 2 Jul 2019 19:38:02 +0000 (19:38 +0000)
commita70043632335f697b0cbbb12d5ef0c5fe0fb999a
tree42c34b71aa595f9badd188a77e73160e7f59377d
parent5fe851b6cd90ceaa4cf468d9403b3920e1d0ae15
[ThinLTO] Add summary entries for index-based WPD

Summary:
If LTOUnit splitting is disabled, the module summary analysis computes
the summary information necessary to perform single implementation
devirtualization during the thin link with the index and no IR. The
information collected from the regular LTO IR in the current hybrid WPD
algorithm is summarized, including:
1) For vtable definitions, record the function pointers and their offset
within the vtable initializer (subsumes the information collected from
IR by tryFindVirtualCallTargets).
2) A record for each type metadata summarizing the vtable definitions
decorated with that metadata (subsumes the TypeIdentiferMap collected
from IR).

Also added are the necessary bitcode records, and the corresponding
assembly support.

The follow-on index-based WPD patch is D55153.

Depends on D53890.

Reviewers: pcc

Subscribers: mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits

Differential Revision: https://reviews.llvm.org/D54815

llvm-svn: 364960
14 files changed:
llvm/include/llvm/Bitcode/LLVMBitCodes.h
llvm/include/llvm/IR/ModuleSummaryIndex.h
llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLParser.h
llvm/lib/AsmParser/LLToken.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
llvm/test/Assembler/thinlto-vtable-summary.ll [new file with mode: 0644]
llvm/test/ThinLTO/X86/devirt.ll [new file with mode: 0644]
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp