ThinLTO: Fix inline assembly references to static functions with CFI
authorSami Tolvanen <samitolvanen@google.com>
Fri, 16 Jul 2021 20:56:54 +0000 (13:56 -0700)
committerSami Tolvanen <samitolvanen@google.com>
Fri, 16 Jul 2021 21:33:34 +0000 (14:33 -0700)
commit8e3b5cb39eef462943ed7556469604ce25c07a1d
tree5c68a52bb3392994884b71e22adc7e15689e4a6a
parent35a18a981f6b0f67899baec46be0086dc1aad757
ThinLTO: Fix inline assembly references to static functions with CFI

Create an internal alias with the original name for static functions
that are renamed in promoteInternals to avoid breaking inline
assembly references to them. This version uses module inline assembly
to avoid issues with LowerTypeTestsModule.

Link: https://github.com/ClangBuiltLinux/linux/issues/1354
Reviewed By: nickdesaulniers, pcc

Differential Revision: https://reviews.llvm.org/D104058
llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
llvm/test/ThinLTO/X86/devirt2.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll [new file with mode: 0644]
llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll