OSDN Git Service

Put "built-in" function definitions in global Used list, for LTO. (fix bug 34169)
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 24 Jul 2018 19:34:37 +0000 (19:34 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 24 Jul 2018 19:34:37 +0000 (19:34 +0000)
commit5df3f9e0708ca0f36e3e879801a9a51ec95278b1
treef48abcfbd8e09d0211a6caf495dbb37714531a37
parentf48b4d01aaa614b1553bf1489b4f276ed46ea224
Put "built-in" function definitions in global Used list, for LTO. (fix bug 34169)

When building with LTO, builtin functions that are defined but whose calls have not been inserted yet, get internalized. The Global Dead Code Elimination phase in the new LTO implementation then removes these function definitions. Later optimizations add calls to those functions, and the linker then dies complaining that there are no definitions. This CL fixes the new LTO implementation to check if a function is builtin, and if so, to not internalize (and later DCE) the function. As part of this fix I needed to move the RuntimeLibcalls.{def,h} files from the CodeGen subidrectory to the IR subdirectory. I have updated all the files that accessed those two files to access their new location.

Fixes PR34169

Patch by Caroline Tice!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337847 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/RuntimeLibcalls.h
include/llvm/IR/RuntimeLibcalls.def [moved from include/llvm/CodeGen/RuntimeLibcalls.def with 100% similarity]
include/llvm/module.modulemap
lib/CodeGen/TargetLoweringBase.cpp
lib/Object/IRSymtab.cpp
lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp