summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-12-16 21:25:01 +0000
committerTeresa Johnson <tejohnson@google.com>2016-12-16 21:25:01 +0000
commita61f5e379675732666744bcba25efbc9922e016a (patch)
treee9fca58ec6916e678a6fc2d90bb2b00c3846c0e5 /llvm/lib/Object/IRObjectFile.cpp
parent3ca147ea3d8c2364542c2e4c2b7ba83fdf5e6dcd (diff)
downloadbcm5719-llvm-a61f5e379675732666744bcba25efbc9922e016a.tar.gz
bcm5719-llvm-a61f5e379675732666744bcba25efbc9922e016a.zip
[ThinLTO] Import composite types as declarations
Summary: When reading the metadata bitcode, create a type declaration when possible for composite types when we are importing. Doing this in the bitcode reader saves memory. Also it works naturally in the case when the type ODR map contains a definition for the same composite type because it was used in the importing module (buildODRType will automatically use the existing definition and not create a type declaration). For Chromium built with -g2, this reduces the aggregate size of the generated native object files by 66% (from 31G to 10G). It reduced the time through the ThinLTO link and backend phases by about 20% on my machine. Reviewers: mehdi_amini, dblaikie, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27775 llvm-svn: 289993
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index 2d055e14470..adbf0de6d1b 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -127,7 +127,8 @@ IRObjectFile::create(MemoryBufferRef Object, LLVMContext &Context) {
std::vector<std::unique_ptr<Module>> Mods;
for (auto BM : *BMsOrErr) {
Expected<std::unique_ptr<Module>> MOrErr =
- BM.getLazyModule(Context, /*ShouldLazyLoadMetadata*/ true);
+ BM.getLazyModule(Context, /*ShouldLazyLoadMetadata*/ true,
+ /*IsImporting*/ false);
if (!MOrErr)
return MOrErr.takeError();
OpenPOWER on IntegriCloud