[ThinLTO] Implement index-based WPD
authorTeresa Johnson <tejohnson@google.com>
Fri, 2 Aug 2019 13:10:52 +0000 (13:10 +0000)
committerTeresa Johnson <tejohnson@google.com>
Fri, 2 Aug 2019 13:10:52 +0000 (13:10 +0000)
commitd2df54e6a55af509b08afa109fe522cd88ad1c33
tree4d339b3b6a25b26612d1c76e97da2ae43ba44227
parent4cfd015bebb6966227964070c6bea738eaf897ae
[ThinLTO] Implement index-based WPD

This patch adds support to the WholeProgramDevirt pass to perform
index-based WPD, which is invoked from ThinLTO during the thin link.

The ThinLTO backend (WPD import phase) behaves the same regardless of
whether the WPD decisions were made with the index-based or (the
existing) IR-based analysis.

Depends on D54815.

Reviewers: pcc

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

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

llvm-svn: 367679
llvm/include/llvm/IR/ModuleSummaryIndex.h
llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
llvm/lib/LTO/LTO.cpp
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/test/ThinLTO/X86/Inputs/devirt2.ll [new file with mode: 0644]
llvm/test/ThinLTO/X86/devirt.ll
llvm/test/ThinLTO/X86/devirt2.ll [new file with mode: 0644]
llvm/test/ThinLTO/X86/nodevirt-nonpromoted-typeid.ll [new file with mode: 0644]
llvm/tools/llvm-lto2/llvm-lto2.cpp