diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -302,7 +302,6 @@ void initializeRenameIndependentSubregsPass(PassRegistry&); void initializeReplaceWithVeclibLegacyPass(PassRegistry &); void initializeResetMachineFunctionPass(PassRegistry&); -void initializeRewriteStatepointsForGCLegacyPassPass(PassRegistry &); void initializeRewriteSymbolsLegacyPassPass(PassRegistry&); void initializeSCEVAAWrapperPassPass(PassRegistry&); void initializeSROALegacyPassPass(PassRegistry&); diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -297,13 +297,6 @@ // FunctionPass *createPlaceSafepointsPass(); -//===----------------------------------------------------------------------===// -// -// RewriteStatepointsForGC - Rewrite any gc.statepoints which do not yet have -// explicit relocations to include explicit relocations. -// -ModulePass *createRewriteStatepointsForGCLegacyPass(); - //===----------------------------------------------------------------------===// // // NaryReassociate - Simplify n-ary operations by reassociation. diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -166,76 +166,6 @@ namespace { -class RewriteStatepointsForGCLegacyPass : public ModulePass { - RewriteStatepointsForGC Impl; - -public: - static char ID; // Pass identification, replacement for typeid - - RewriteStatepointsForGCLegacyPass() : ModulePass(ID), Impl() { - initializeRewriteStatepointsForGCLegacyPassPass( - *PassRegistry::getPassRegistry()); - } - - bool runOnModule(Module &M) override { - bool Changed = false; - for (Function &F : M) { - // Nothing to do for declarations. - if (F.isDeclaration() || F.empty()) - continue; - - // Policy choice says not to rewrite - the most common reason is that - // we're compiling code without a GCStrategy. - if (!shouldRewriteStatepointsIn(F)) - continue; - - TargetTransformInfo &TTI = - getAnalysis().getTTI(F); - const TargetLibraryInfo &TLI = - getAnalysis().getTLI(F); - auto &DT = getAnalysis(F).getDomTree(); - - Changed |= Impl.runOnFunction(F, DT, TTI, TLI); - } - - if (!Changed) - return false; - - // stripNonValidData asserts that shouldRewriteStatepointsIn - // returns true for at least one function in the module. Since at least - // one function changed, we know that the precondition is satisfied. - stripNonValidData(M); - return true; - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - // We add and rewrite a bunch of instructions, but don't really do much - // else. We could in theory preserve a lot more analyses here. - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - } -}; - -} // end anonymous namespace - -char RewriteStatepointsForGCLegacyPass::ID = 0; - -ModulePass *llvm::createRewriteStatepointsForGCLegacyPass() { - return new RewriteStatepointsForGCLegacyPass(); -} - -INITIALIZE_PASS_BEGIN(RewriteStatepointsForGCLegacyPass, - "rewrite-statepoints-for-gc", - "Make relocations explicit at statepoints", false, false) -INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) -INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass) -INITIALIZE_PASS_END(RewriteStatepointsForGCLegacyPass, - "rewrite-statepoints-for-gc", - "Make relocations explicit at statepoints", false, false) - -namespace { - struct GCPtrLivenessData { /// Values defined in this block. MapVector> KillSet; diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp --- a/llvm/lib/Transforms/Scalar/Scalar.cpp +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp @@ -54,7 +54,6 @@ initializeReassociateLegacyPassPass(Registry); initializeRedundantDbgInstEliminationPass(Registry); initializeRegToMemLegacyPass(Registry); - initializeRewriteStatepointsForGCLegacyPassPass(Registry); initializeScalarizeMaskedMemIntrinLegacyPassPass(Registry); initializeSROALegacyPassPass(Registry); initializeCFGSimplifyPassPass(Registry);