[ThinLTO/WPD] Ensure devirtualized targets use promoted symbol when necessary
authorTeresa Johnson <tejohnson@google.com>
Wed, 2 Oct 2019 16:36:59 +0000 (16:36 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 2 Oct 2019 16:36:59 +0000 (16:36 +0000)
commit077cc3fcb01d2a38d2591b2e5de3677bdcf8c86d
tree5d8fa80cc507ee8efc0c40ac8c5f0be720c7687d
parent49c23908777aba4ed42427db2cd7acd141b0406e
[ThinLTO/WPD] Ensure devirtualized targets use promoted symbol when necessary

Summary:
This fixes a hole in the handling of devirtualized targets that were
local but need promoting due to devirtualization in another module. We
were not correctly referencing the promoted symbol in some cases. Make
sure the code that updates the name also looks at the ExportedGUIDs set
by utilizing a callback that checks all conditions (the callback
utilized by the internalization/promotion code).

Reviewers: pcc, davidxl, hiraditya

Subscribers: mehdi_amini, Prazek, inglorion, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

llvm-svn: 373485
llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
llvm/lib/LTO/LTO.cpp
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/test/ThinLTO/X86/Inputs/devirt_promote.ll [new file with mode: 0644]
llvm/test/ThinLTO/X86/devirt_promote.ll [new file with mode: 0644]