]> granicus.if.org Git - llvm/commit
LowerTypeTests: Drop function type metadata only if we're going to replace it.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 20 Jul 2017 18:02:05 +0000 (18:02 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 20 Jul 2017 18:02:05 +0000 (18:02 +0000)
commitad1bdb9440deeecf94e760727d4d9fd16f1e8cc4
tree544bd7c44b23ef42980ac886f917767e34c4a5ab
parentd56619e6f9c73399c919bc69900b67632607a53f
LowerTypeTests: Drop function type metadata only if we're going to replace it.

Previously we were (mis)handling jump table members with a prevailing
definition in a full LTO module and a non-prevailing definition in a
ThinLTO module by dropping type metadata on those functions entirely,
which would cause type tests involving such functions to fail.

This patch causes us to drop metadata only if we are about to replace
it with metadata from cfi.functions.

We also want to replace metadata for available_externally functions,
which can arise in the opposite scenario (prevailing ThinLTO
definition, non-prevailing full LTO definition). The simplest way
to handle that is to remove the definition; there's little value in
keeping it around at this point (i.e. after most optimization passes
have already run) and later code will try to use the function's linkage
to create an alias, which would result in invalid IR if the function
is available_externally.

Fixes PR33832.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308642 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/LowerTypeTests.cpp
test/Transforms/LowerTypeTests/export-icall.ll