[PATCH] D91673: [PGO] Enable preinline and cleanup when optimize for size
Zequan Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 18:06:07 PST 2020
zequanwu updated this revision to Diff 305948.
zequanwu added a comment.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
update wrong diff.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91673/new/
https://reviews.llvm.org/D91673
Files:
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
Index: llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -330,10 +330,8 @@
return;
// Perform the preinline and cleanup passes for O1 and above.
- // And avoid doing them if optimizing for size.
// We will not do this inline for context sensitive PGO (when IsCS is true).
- if (OptLevel > 0 && SizeLevel == 0 && !DisablePreInliner &&
- PGOSampleUse.empty() && !IsCS) {
+ if (OptLevel > 0 && !DisablePreInliner && PGOSampleUse.empty() && !IsCS) {
// Create preinline pass. We construct an InlineParams object and specify
// the threshold here to avoid the command line options of the regular
// inliner to influence pre-inlining. The only fields of InlineParams we
@@ -342,7 +340,7 @@
IP.DefaultThreshold = PreInlineThreshold;
// FIXME: The hint threshold has the same value used by the regular inliner.
// This should probably be lowered after performance testing.
- IP.HintThreshold = 325;
+ IP.HintThreshold = SizeLevel > 0 ? 75 : 325;
MPM.add(createFunctionInliningPass(IP));
MPM.add(createSROAPass());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91673.305948.patch
Type: text/x-patch
Size: 1245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/76c37840/attachment.bin>
More information about the llvm-commits
mailing list