[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 13:05:07 PST 2022
luna updated this revision to Diff 410623.
luna added a comment.
Invert the added option to 'disable-sample-loader-inlining'
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120344/new/
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> DisableSampleLoaderInlining(
+ "disable-sample-loader-inlining", cl::Hidden, cl::init(false),
+ cl::desc("If true, 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 (DisableSampleLoaderInlining)
+ 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 (DisableSampleLoaderInlining)
+ 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.410623.patch
Type: text/x-patch
Size: 1590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220222/ca4a5eb6/attachment.bin>
More information about the llvm-commits
mailing list