ThinLTO: Fix inline assembly references to static functions with CFI
authorSami Tolvanen <samitolvanen@google.com>
Wed, 23 Jun 2021 17:09:21 +0000 (10:09 -0700)
committerSami Tolvanen <samitolvanen@google.com>
Wed, 23 Jun 2021 17:56:13 +0000 (10:56 -0700)
commite3d24b45b8f808ec66213e134c4ceda5202fbe31
treed764d1ffec331d6d7c5704d1f1903bba64917660
parentec08f03be3942d4ae6694d0f7a9b490fe3cbba9b
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 relands commit 4474958d3a97dede2caa0920f7c4a4dc7aac57d3
with a fix to a use-of-uninitialized-value error that tripped
MemorySanitizer.

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/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll [new file with mode: 0644]