[PATCH] D127245: [mlgo] Disable accounting upon ForceStop

Jin Xin Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 12:55:33 PDT 2022


Northbadge created this revision.
Northbadge added a reviewer: mtrofin.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Northbadge requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Once ForceStop is set to true, we only return positive inlining advice when it is mandatory; There is no need for further node/edge accounting.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127245

Files:
  llvm/lib/Analysis/MLInlineAdvisor.cpp


Index: llvm/lib/Analysis/MLInlineAdvisor.cpp
===================================================================
--- llvm/lib/Analysis/MLInlineAdvisor.cpp
+++ llvm/lib/Analysis/MLInlineAdvisor.cpp
@@ -133,6 +133,8 @@
 }
 
 void MLInlineAdvisor::onPassEntry() {
+  if (ForceStop)
+    return;
   FPICache.clear();
   // Function passes executed between InlinerPass runs may have changed the
   // module-wide features.
@@ -174,7 +176,7 @@
 void MLInlineAdvisor::onPassExit(LazyCallGraph::SCC *LastSCC) {
   // No need to keep this around - function passes will invalidate it.
   FPICache.clear();
-  if (!LastSCC)
+  if (!LastSCC || ForceStop)
     return;
   // Keep track of the nodes and edges we last saw. Then, in onPassEntry,
   // we update the node count and edge count from the subset of these nodes that


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127245.434919.patch
Type: text/x-patch
Size: 813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220607/6b86b79e/attachment.bin>


More information about the llvm-commits mailing list