[PATCH] D120344: [SampleProf][Inliner] Add an option to turn off inliner in sample-profile pass.
Mingming Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 22 12:08:43 PST 2022
luna created this revision.
Herald added subscribers: ormris, wenlei, hiraditya.
luna added reviewers: wenlei, xur.
luna added a subscriber: davidxl.
luna published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Use case is offline evaluation (for inliner effectiveness) or debugging.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D120344
Files:
llvm/lib/Transforms/IPO/SampleProfile.cpp
Index: llvm/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -183,6 +183,11 @@
cl::desc("Inline cold call sites in profile loader if it's beneficial "
"for code size."));
+static cl::opt<bool> ProfileInlineFunctions(
+ "sample-profile-inline-functions", cl::Hidden, cl::init(true),
+ cl::desc("If false, turn off inliner in sample profile loader. Used for "
+ "evaluation or debugging."));
+
cl::opt<int> ProfileInlineGrowthLimit(
"sample-profile-inline-growth-limit", cl::Hidden, cl::init(12),
cl::desc("The size growth ratio limit for proirity-based sample profile "
@@ -1113,6 +1118,8 @@
/// \returns True if there is any inline happened.
bool SampleProfileLoader::inlineHotFunctions(
Function &F, DenseSet<GlobalValue::GUID> &InlinedGUIDs) {
+ if (!ProfileInlineFunctions)
+ return false;
// ProfAccForSymsInList is used in callsiteIsHot. The assertion makes sure
// Profile symbol list is ignored when profile-sample-accurate is on.
assert((!ProfAccForSymsInList ||
@@ -1389,7 +1396,8 @@
bool SampleProfileLoader::inlineHotFunctionsWithPriority(
Function &F, DenseSet<GlobalValue::GUID> &InlinedGUIDs) {
-
+ if (!ProfileInlineFunctions)
+ return false;
// ProfAccForSymsInList is used in callsiteIsHot. The assertion makes sure
// Profile symbol list is ignored when profile-sample-accurate is on.
assert((!ProfAccForSymsInList ||
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120344.410606.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220222/5f8075d9/attachment.bin>
More information about the llvm-commits
mailing list