[PATCH] D70207: [PGO][PGSO] Temporarily disable the large working set size behavior.

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 14:02:00 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f0969daf9d0: [PGO][PGSO] Temporarily disable the large working set size behavior. (authored by yamauchi).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70207/new/

https://reviews.llvm.org/D70207

Files:
  llvm/include/llvm/Transforms/Utils/SizeOpts.h
  llvm/lib/Transforms/Utils/SizeOpts.cpp


Index: llvm/lib/Transforms/Utils/SizeOpts.cpp
===================================================================
--- llvm/lib/Transforms/Utils/SizeOpts.cpp
+++ llvm/lib/Transforms/Utils/SizeOpts.cpp
@@ -23,6 +23,11 @@
     cl::desc("Apply the profile guided size optimizations only "
              "if the working set size is large (except for cold code.)"));
 
+cl::opt<bool> PGSOColdCodeOnly(
+    "pgso-cold-code-only", cl::Hidden, cl::init(true),
+    cl::desc("Apply the profile guided size optimizations only "
+             "to cold code."));
+
 cl::opt<bool> ForcePGSO(
     "force-pgso", cl::Hidden, cl::init(false),
     cl::desc("Force the (profiled-guided) size optimizations. "));
Index: llvm/include/llvm/Transforms/Utils/SizeOpts.h
===================================================================
--- llvm/include/llvm/Transforms/Utils/SizeOpts.h
+++ llvm/include/llvm/Transforms/Utils/SizeOpts.h
@@ -21,6 +21,7 @@
 
 extern cl::opt<bool> EnablePGSO;
 extern cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
+extern cl::opt<bool> PGSOColdCodeOnly;
 extern cl::opt<bool> ForcePGSO;
 extern cl::opt<int> PgsoCutoffInstrProf;
 extern cl::opt<int> PgsoCutoffSampleProf;
@@ -42,7 +43,8 @@
     return true;
   if (!EnablePGSO)
     return false;
-  if (PGSOLargeWorkingSetSizeOnly && !PSI->hasLargeWorkingSetSize()) {
+  if (PGSOColdCodeOnly ||
+      (PGSOLargeWorkingSetSizeOnly && !PSI->hasLargeWorkingSetSize())) {
     // Even if the working set size isn't large, size-optimize cold code.
     return AdapterT::isFunctionColdInCallGraph(F, PSI, *BFI);
   }
@@ -61,7 +63,8 @@
     return true;
   if (!EnablePGSO)
     return false;
-  if (PGSOLargeWorkingSetSizeOnly && !PSI->hasLargeWorkingSetSize()) {
+  if (PGSOColdCodeOnly ||
+      (PGSOLargeWorkingSetSizeOnly && !PSI->hasLargeWorkingSetSize())) {
     // Even if the working set size isn't large, size-optimize cold code.
     return AdapterT::isColdBlock(BB, PSI, BFI);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70207.229184.patch
Type: text/x-patch
Size: 1947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191113/cac090c0/attachment.bin>


More information about the llvm-commits mailing list