[llvm] 2d620a6 - [LegacyPM] Remove PlaceSafepointsLegacyPass
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 24 07:34:00 PDT 2023
Author: Kazu Hirata
Date: 2023-06-24T07:33:49-07:00
New Revision: 2d620a6c4ecebd95711ba04f957709f4f0aa6860
URL: https://github.com/llvm/llvm-project/commit/2d620a6c4ecebd95711ba04f957709f4f0aa6860
DIFF: https://github.com/llvm/llvm-project/commit/2d620a6c4ecebd95711ba04f957709f4f0aa6860.diff
LOG: [LegacyPM] Remove PlaceSafepointsLegacyPass
Differential Revision: https://reviews.llvm.org/D153678
Added:
Modified:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index ac79d42fe9329..108de472e9081 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -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 &);
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index eeb10d1074238..75d72d7bcd8e0 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -274,16 +274,6 @@ FunctionPass *createSpeculativeExecutionIfHasBranchDivergencePass();
//
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.
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index 9ae3c99aafa63..0266eb1a9f502 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -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
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 10f645a749b63..37b032e4d7c7e 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -63,6 +63,5 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeSpeculativeExecutionLegacyPassPass(Registry);
initializeStraightLineStrengthReduceLegacyPassPass(Registry);
initializePlaceBackedgeSafepointsLegacyPassPass(Registry);
- initializePlaceSafepointsLegacyPassPass(Registry);
initializeLoopSimplifyCFGLegacyPassPass(Registry);
}
More information about the llvm-commits
mailing list