aboutsummaryrefslogtreecommitdiff
path: root/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
commitf638013746e2691e4cd7e847bbec6197595ad356 (patch)
treeef8a0b35f94731ca2453f5db6e1fac03d742b092 /lib/Object/IRObjectFile.cpp
parent569cd219c717dbcd16586d8ff5e4aaac6b737939 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/IRObjectFile.cpp')
-rw-r--r--lib/Object/IRObjectFile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Object/IRObjectFile.cpp b/lib/Object/IRObjectFile.cpp
index 2d055e14470..adbf0de6d1b 100644
--- a/lib/Object/IRObjectFile.cpp
+++ b/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();