[LTO/WPD] Allow devirtualization to function alias in vtable
authorTeresa Johnson <tejohnson@google.com>
Fri, 17 Feb 2023 15:38:01 +0000 (07:38 -0800)
committerTeresa Johnson <tejohnson@google.com>
Thu, 23 Feb 2023 22:04:05 +0000 (14:04 -0800)
commitc1b3e888449045db6b57353b2b3ebbb56541fb6c
treea692e02a1c5a0bc26bad959f00f218fb7479891c
parent7b7db789ff3d8750d1098dcc84aa29d11877d610
[LTO/WPD] Allow devirtualization to function alias in vtable

Follow on to D144209 to support single implementation devirtualization
for Regular LTO when the vtable holds a function alias.

For now I have prevented other optimizations performed in regular LTO
that need to analyze the contents of the function target when the vtable
holds an alias, as I'm not sure they are always correct to perform in
that case.

Differential Revision: https://reviews.llvm.org/D144270
llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/test/ThinLTO/X86/devirt_function_alias2.ll