OSDN Git Service

[ThinLTO] Enable importing of aliases as copy of aliasee
authorTeresa Johnson <tejohnson@google.com>
Sat, 16 Dec 2017 00:18:12 +0000 (00:18 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sat, 16 Dec 2017 00:18:12 +0000 (00:18 +0000)
commit2140d926da5be829f23fc59bcaf8fe95800faed0
tree20ac5e04344c3f76a1d630bf50e64926602bce3a
parent2d82935d1ad3407029669a0854650f9aa7866150
[ThinLTO] Enable importing of aliases as copy of aliasee

Summary:
This implements a missing feature to allow importing of aliases, which
was previously disabled because alias cannot be available_externally.
We instead import an alias as a copy of its aliasee.

Some additional work was required in the IndexBitcodeWriter for the
distributed build case, to ensure that the aliasee has a value id
in the distributed index file (i.e. even when it is not being
imported directly).

This is a performance win in codes that have many aliases, e.g. C++
applications that have many constructor and destructor aliases.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320895 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/IR/ModuleSummaryIndex.h
include/llvm/IR/Value.h
include/llvm/Transforms/IPO/FunctionImport.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/IR/Value.cpp
lib/Transforms/IPO/FunctionImport.cpp
test/ThinLTO/X86/Inputs/distributed_import.ll
test/ThinLTO/X86/Inputs/distributed_indexes.ll
test/ThinLTO/X86/alias_import.ll
test/ThinLTO/X86/distributed_import.ll
test/ThinLTO/X86/distributed_indexes.ll
test/ThinLTO/X86/funcimport.ll
test/Transforms/FunctionImport/funcimport.ll