summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-12-01 05:11:46 +0000
committerTeresa Johnson <tejohnson@google.com>2018-12-01 05:11:46 +0000
commit5b8ff375c84a57e63a50ed223b1f8896da149a65 (patch)
treeb9f8450206eb6a78a8c51601ca7ade75916f12a6 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
parent757d296222ae1fa1baa9ca4a0379fab6ace2a612 (diff)
downloadbcm5719-llvm-5b8ff375c84a57e63a50ed223b1f8896da149a65.tar.gz
bcm5719-llvm-5b8ff375c84a57e63a50ed223b1f8896da149a65.zip
[ThinLTO] Allow importing of functions with var args
Summary: Follow up to D54270, which allowed importing of var args functions unless they called va_start. As pointed out in the post-commit comments on that patch, the inliner can handle functions that call va_start in certain situations as well. Go ahead and enable importing of all var args functions. Measurements on a large binary show that this increases imports and binary size by an insignificant amount. Reviewers: davidxl Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D54607 llvm-svn: 348068
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index 5a13149c022..fe318548b64 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -256,15 +256,10 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
std::vector<const Instruction *> NonVolatileLoads;
bool HasInlineAsmMaybeReferencingInternal = false;
- bool InitsVarArgs = false;
for (const BasicBlock &BB : F)
for (const Instruction &I : BB) {
if (isa<DbgInfoIntrinsic>(I))
continue;
- if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(&I)) {
- if (II->getIntrinsicID() == Intrinsic::vastart)
- InitsVarArgs = true;
- }
++NumInsts;
if (isNonVolatileLoad(&I)) {
// Postpone processing of non-volatile load instructions
@@ -397,11 +392,9 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
F.hasFnAttribute(Attribute::ReadNone),
F.hasFnAttribute(Attribute::ReadOnly),
F.hasFnAttribute(Attribute::NoRecurse), F.returnDoesNotAlias(),
- // Inliner doesn't handle variadic functions with va_start calls.
// FIXME: refactor this to use the same code that inliner is using.
- InitsVarArgs ||
- // Don't try to import functions with noinline attribute.
- F.getAttributes().hasFnAttribute(Attribute::NoInline)};
+ // Don't try to import functions with noinline attribute.
+ F.getAttributes().hasFnAttribute(Attribute::NoInline)};
auto FuncSummary = llvm::make_unique<FunctionSummary>(
Flags, NumInsts, FunFlags, std::move(Refs), CallGraphEdges.takeVector(),
TypeTests.takeVector(), TypeTestAssumeVCalls.takeVector(),
OpenPOWER on IntegriCloud