[LegacyPM] Remove PlaceSafepointsLegacyPass
authorKazu Hirata <kazu@google.com>
Sat, 24 Jun 2023 14:33:49 +0000 (07:33 -0700)
committerKazu Hirata <kazu@google.com>
Sat, 24 Jun 2023 14:33:49 +0000 (07:33 -0700)
Differential Revision: https://reviews.llvm.org/D153678

llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp

index ac79d42..108de47 100644 (file)
@@ -247,7 +247,6 @@ void initializePeepholeOptimizerPass(PassRegistry&);
 void initializePhiValuesWrapperPassPass(PassRegistry&);
 void initializePhysicalRegisterUsageInfoPass(PassRegistry&);
 void initializePlaceBackedgeSafepointsLegacyPassPass(PassRegistry &);
-void initializePlaceSafepointsLegacyPassPass(PassRegistry &);
 void initializePostDomOnlyPrinterWrapperPassPass(PassRegistry &);
 void initializePostDomOnlyViewerWrapperPassPass(PassRegistry &);
 void initializePostDomPrinterWrapperPassPass(PassRegistry &);
index eeb10d1..75d72d7 100644 (file)
@@ -276,16 +276,6 @@ FunctionPass *createStraightLineStrengthReducePass();
 
 //===----------------------------------------------------------------------===//
 //
-// PlaceSafepoints - Rewrite any IR calls to gc.statepoints and insert any
-// safepoint polls (method entry, backedge) that might be required.  This pass
-// does not generate explicit relocation sequences - that's handled by
-// RewriteStatepointsForGC which can be run at an arbitrary point in the pass
-// order following this pass.
-//
-FunctionPass *createPlaceSafepointsPass();
-
-//===----------------------------------------------------------------------===//
-//
 // NaryReassociate - Simplify n-ary operations by reassociation.
 //
 FunctionPass *createNaryReassociatePass();
index 9ae3c99..0266eb1 100644 (file)
@@ -246,63 +246,6 @@ bool PlaceBackedgeSafepointsLegacyPass::runOnLoop(Loop *L) {
   return false;
 }
 
-namespace {
-class PlaceSafepointsLegacyPass : public FunctionPass {
-public:
-  static char ID; // Pass identification, replacement for typeid
-
-  PlaceSafepointsLegacyPass() : FunctionPass(ID) {
-    initializePlaceSafepointsLegacyPassPass(*PassRegistry::getPassRegistry());
-  }
-
-  bool runOnFunction(Function &F) override;
-
-  StringRef getPassName() const override { return "Safepoint Placement"; }
-
-  void getAnalysisUsage(AnalysisUsage &AU) const override {
-    // We modify the graph wholesale (inlining, block insertion, etc).  We
-    // preserve nothing at the moment.  We could potentially preserve dom tree
-    // if that was worth doing
-    AU.addRequired<TargetLibraryInfoWrapperPass>();
-  }
-
-private:
-  PlaceSafepointsPass Impl;
-};
-} // end anonymous namespace
-
-char PlaceSafepointsLegacyPass::ID = 0;
-
-INITIALIZE_PASS_BEGIN(PlaceSafepointsLegacyPass, "place-safepoints",
-                      "Place Safepoints", false, false)
-INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
-INITIALIZE_PASS_END(PlaceSafepointsLegacyPass, "place-safepoints",
-                    "Place Safepoints", false, false)
-
-FunctionPass *llvm::createPlaceSafepointsPass() {
-  return new PlaceSafepointsLegacyPass();
-}
-
-bool PlaceSafepointsLegacyPass::runOnFunction(Function &F) {
-  if (skipFunction(F))
-    return false;
-
-  LLVM_DEBUG(dbgs() << "********** Begin Safepoint Placement **********\n");
-  LLVM_DEBUG(dbgs() << "********** Function: " << F.getName() << '\n');
-
-  bool MadeChange =
-      Impl.runImpl(F, getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F));
-
-  if (MadeChange) {
-    LLVM_DEBUG(dbgs() << "********** Function after Safepoint Placement: "
-                      << F.getName() << '\n');
-    LLVM_DEBUG(dbgs() << F);
-  }
-  LLVM_DEBUG(dbgs() << "********** End Safepoint Placement **********\n");
-
-  return MadeChange;
-}
-
 bool PlaceSafepointsPass::runImpl(Function &F, const TargetLibraryInfo &TLI) {
   if (F.isDeclaration() || F.empty()) {
     // This is a declaration, nothing to do.  Must exit early to avoid crash in
index 10f645a..37b032e 100644 (file)
@@ -63,6 +63,5 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
   initializeSpeculativeExecutionLegacyPassPass(Registry);
   initializeStraightLineStrengthReduceLegacyPassPass(Registry);
   initializePlaceBackedgeSafepointsLegacyPassPass(Registry);
-  initializePlaceSafepointsLegacyPassPass(Registry);
   initializeLoopSimplifyCFGLegacyPassPass(Registry);
 }