aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ModuleSummaryIndex.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2020-01-30 09:56:43 -0800
committerTeresa Johnson <tejohnson@google.com>2020-01-30 10:12:48 -0800
commitc45bb326a681570b88dd315299c10c2242c143a9 (patch)
treed05aaee64b800cb7e7713608279ecd3a1aaf0b01 /llvm/lib/IR/ModuleSummaryIndex.cpp
parentf2a436058fcbc11291e73badb44e243f61046183 (diff)
downloadllvm-c45bb326a681570b88dd315299c10c2242c143a9.zip
llvm-c45bb326a681570b88dd315299c10c2242c143a9.tar.gz
llvm-c45bb326a681570b88dd315299c10c2242c143a9.tar.bz2
[ThinLTO] Disable "Always import constants" due to compile time issues
Summary: Disable the always importing of constants introduced in D70404 by default under a new internal option, since it is causing order of magnitude compile time regressions during the thin link. Will continue investigating why the regressions occur. Reviewers: evgeny777, wmi Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73724
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r--llvm/lib/IR/ModuleSummaryIndex.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index 301df9a..0a43e17 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -31,6 +31,12 @@ static cl::opt<bool> PropagateAttrs("propagate-attrs", cl::init(true),
cl::Hidden,
cl::desc("Propagate attributes in index"));
+// FIXME: Enable again when thin link compile time regressions understood and
+// addressed
+static cl::opt<bool> ImportConstantsWithRefs(
+ "import-constants-with-refs", cl::init(false), cl::Hidden,
+ cl::desc("Import constant global variables with references"));
+
FunctionSummary FunctionSummary::ExternalNode =
FunctionSummary::makeDummyFunctionSummary({});
@@ -221,8 +227,8 @@ bool ModuleSummaryIndex::canImportGlobalVar(GlobalValueSummary *S,
// c) Link error (external declaration with internal definition).
// However we do not promote objects referenced by writeonly GV
// initializer by means of converting it to 'zeroinitializer'
- return !GVS->isConstant() && !isReadOnly(GVS) && !isWriteOnly(GVS) &&
- GVS->refs().size();
+ return !(ImportConstantsWithRefs && GVS->isConstant()) &&
+ !isReadOnly(GVS) && !isWriteOnly(GVS) && GVS->refs().size();
};
auto *GVS = cast<GlobalVarSummary>(S->getBaseObject());