diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index 6577c3ab46b64..bd81fbe35ca91 100644 --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -172,7 +172,6 @@ void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&); void initializeLoopExtractorLegacyPassPass(PassRegistry &); void initializeLoopInfoWrapperPassPass(PassRegistry&); void initializeLoopPassPass(PassRegistry&); -void initializeLoopPredicationLegacyPassPass(PassRegistry&); void initializeLoopRotateLegacyPassPass(PassRegistry&); void initializeLoopSimplifyPass(PassRegistry&); void initializeLoopStrengthReducePass(PassRegistry&); diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h index 933511cf09f53..927c2d8cde5c4 100644 --- a/llvm/include/llvm/LinkAllPasses.h +++ b/llvm/include/llvm/LinkAllPasses.h @@ -86,7 +86,6 @@ namespace { (void) llvm::createLICMPass(); (void) llvm::createLazyValueInfoPass(); (void) llvm::createLoopExtractorPass(); - (void) llvm::createLoopPredicationPass(); (void) llvm::createLoopSimplifyPass(); (void) llvm::createLoopStrengthReducePass(); (void) llvm::createLoopUnrollPass(); diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h index 9cd73676e90b2..7e50e216fb7dc 100644 --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -51,12 +51,6 @@ FunctionPass *createSROAPass(bool PreserveCFG = true); // Pass *createLICMPass(); -//===----------------------------------------------------------------------===// -// -// LoopPredication - This pass does loop predication on guards. -// -Pass *createLoopPredicationPass(); - //===----------------------------------------------------------------------===// // // LoopStrengthReduce - This pass is strength reduces GEP instructions that use diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp index 55079b4a42d2f..027dbb9c0f71a 100644 --- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp @@ -327,49 +327,8 @@ class LoopPredication { bool runOnLoop(Loop *L); }; -class LoopPredicationLegacyPass : public LoopPass { -public: - static char ID; - LoopPredicationLegacyPass() : LoopPass(ID) { - initializeLoopPredicationLegacyPassPass(*PassRegistry::getPassRegistry()); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.addRequired(); - getLoopAnalysisUsage(AU); - AU.addPreserved(); - } - - bool runOnLoop(Loop *L, LPPassManager &LPM) override { - if (skipLoop(L)) - return false; - auto *SE = &getAnalysis().getSE(); - auto *LI = &getAnalysis().getLoopInfo(); - auto *DT = &getAnalysis().getDomTree(); - auto *MSSAWP = getAnalysisIfAvailable(); - std::unique_ptr MSSAU; - if (MSSAWP) - MSSAU = std::make_unique(&MSSAWP->getMSSA()); - auto *AA = &getAnalysis().getAAResults(); - LoopPredication LP(AA, DT, SE, LI, MSSAU ? MSSAU.get() : nullptr); - return LP.runOnLoop(L); - } -}; - -char LoopPredicationLegacyPass::ID = 0; } // end namespace -INITIALIZE_PASS_BEGIN(LoopPredicationLegacyPass, "loop-predication", - "Loop predication", false, false) -INITIALIZE_PASS_DEPENDENCY(BranchProbabilityInfoWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LoopPass) -INITIALIZE_PASS_END(LoopPredicationLegacyPass, "loop-predication", - "Loop predication", false, false) - -Pass *llvm::createLoopPredicationPass() { - return new LoopPredicationLegacyPass(); -} - PreservedAnalyses LoopPredicationPass::run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U) { diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp index 12bb96d4e38b8..8fee751476263 100644 --- a/llvm/lib/Transforms/Scalar/Scalar.cpp +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp @@ -30,7 +30,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) { initializeInstSimplifyLegacyPassPass(Registry); initializeLegacyLICMPassPass(Registry); initializeLoopDataPrefetchLegacyPassPass(Registry); - initializeLoopPredicationLegacyPassPass(Registry); initializeLoopRotateLegacyPassPass(Registry); initializeLoopStrengthReducePass(Registry); initializeLoopUnrollPass(Registry);