[llvm] [Analysis] Remove skipSCC (PR #127412)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 16 11:51:46 PST 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/127412

The last use was removed in:

  commit fa6ea7a419f37befbed04368bcb8af4c718facbb
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   Mon Mar 20 11:18:35 2023 -0700


>From 55b644975a039596051239c84c7f1411ae0c12e0 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 15 Feb 2025 20:39:31 -0800
Subject: [PATCH] [Analysis] Remove skipSCC

The last use was removed in:

  commit fa6ea7a419f37befbed04368bcb8af4c718facbb
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   Mon Mar 20 11:18:35 2023 -0700
---
 llvm/docs/OptBisect.rst                       |  1 -
 llvm/include/llvm/Analysis/CallGraphSCCPass.h |  5 -----
 llvm/lib/Analysis/CallGraphSCCPass.cpp        | 22 -------------------
 llvm/lib/Transforms/IPO/AlwaysInliner.cpp     |  2 +-
 4 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/llvm/docs/OptBisect.rst b/llvm/docs/OptBisect.rst
index 809f54883e5a9..0e4d31acbe71e 100644
--- a/llvm/docs/OptBisect.rst
+++ b/llvm/docs/OptBisect.rst
@@ -157,7 +157,6 @@ to make this check uniform across all passes.  These helper functions are:
 .. code-block:: c++
 
   bool ModulePass::skipModule(Module &M);
-  bool CallGraphSCCPass::skipSCC(CallGraphSCC &SCC);
   bool FunctionPass::skipFunction(const Function &F);
   bool LoopPass::skipLoop(const Loop *L);
 
diff --git a/llvm/include/llvm/Analysis/CallGraphSCCPass.h b/llvm/include/llvm/Analysis/CallGraphSCCPass.h
index d0d81605436ea..e8714bae8f4d9 100644
--- a/llvm/include/llvm/Analysis/CallGraphSCCPass.h
+++ b/llvm/include/llvm/Analysis/CallGraphSCCPass.h
@@ -76,11 +76,6 @@ class CallGraphSCCPass : public Pass {
   /// the call graph.  If the derived class implements this method, it should
   /// always explicitly call the implementation here.
   void getAnalysisUsage(AnalysisUsage &Info) const override;
-
-protected:
-  /// Optional passes call this function to check whether the pass should be
-  /// skipped. This is the case when optimization bisect is over the limit.
-  bool skipSCC(CallGraphSCC &SCC) const;
 };
 
 /// CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index 7caf814cdb2d7..441f0c5d2f34b 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -725,28 +725,6 @@ Pass *CallGraphSCCPass::createPrinterPass(raw_ostream &OS,
   return new PrintCallGraphPass(Banner, OS);
 }
 
-static std::string getDescription(const CallGraphSCC &SCC) {
-  std::string Desc = "SCC (";
-  ListSeparator LS;
-  for (CallGraphNode *CGN : SCC) {
-    Desc += LS;
-    Function *F = CGN->getFunction();
-    if (F)
-      Desc += F->getName();
-    else
-      Desc += "<<null function>>";
-  }
-  Desc += ")";
-  return Desc;
-}
-
-bool CallGraphSCCPass::skipSCC(CallGraphSCC &SCC) const {
-  OptPassGate &Gate =
-      SCC.getCallGraph().getModule().getContext().getOptPassGate();
-  return Gate.isEnabled() &&
-         !Gate.shouldRunPass(this->getPassName(), getDescription(SCC));
-}
-
 char DummyCGSCCPass::ID = 0;
 
 INITIALIZE_PASS(DummyCGSCCPass, "DummyCGSCCPass", "DummyCGSCCPass", false,
diff --git a/llvm/lib/Transforms/IPO/AlwaysInliner.cpp b/llvm/lib/Transforms/IPO/AlwaysInliner.cpp
index 20fc630a74a86..921fe8c18aa72 100644
--- a/llvm/lib/Transforms/IPO/AlwaysInliner.cpp
+++ b/llvm/lib/Transforms/IPO/AlwaysInliner.cpp
@@ -126,7 +126,7 @@ struct AlwaysInlinerLegacyPass : public ModulePass {
     initializeAlwaysInlinerLegacyPassPass(*PassRegistry::getPassRegistry());
   }
 
-  /// Main run interface method.  We override here to avoid calling skipSCC().
+  /// Main run interface method.
   bool runOnModule(Module &M) override {
 
     auto &PSI = getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();



More information about the llvm-commits mailing list