From: Fangrui Song Date: Wed, 15 Feb 2023 07:53:39 +0000 (-0800) Subject: [LoopFuse] Remove legacy pass X-Git-Tag: upstream/17.0.6~17448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1eb3db780b7d6e2aea89de1e71664fa8b69ef39;p=platform%2Fupstream%2Fllvm.git [LoopFuse] Remove legacy pass Following recent changes to remove non-core legacy passes. --- diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index e51c712..13baf94 100644 --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -209,7 +209,6 @@ void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&); void initializeLoopDeletionLegacyPassPass(PassRegistry&); void initializeLoopExtractorLegacyPassPass(PassRegistry &); void initializeLoopGuardWideningLegacyPassPass(PassRegistry&); -void initializeLoopFuseLegacyPass(PassRegistry&); void initializeLoopIdiomRecognizeLegacyPassPass(PassRegistry&); void initializeLoopInfoWrapperPassPass(PassRegistry&); void initializeLoopInstSimplifyLegacyPassPass(PassRegistry&); diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h index c70a814..8c45d2d 100644 --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -468,12 +468,6 @@ FunctionPass *createNaryReassociatePass(); //===----------------------------------------------------------------------===// // -// LoopFuse - Fuse loops. -// -FunctionPass *createLoopFusePass(); - -//===----------------------------------------------------------------------===// -// // LoopDataPrefetch - Perform data prefetching in loops. // FunctionPass *createLoopDataPrefetchPass(); diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp index 0eecec3..15e59de 100644 --- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp +++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp @@ -2061,51 +2061,6 @@ private: return FC0.L; } }; - -struct LoopFuseLegacy : public FunctionPass { - - static char ID; - - LoopFuseLegacy() : FunctionPass(ID) { - initializeLoopFuseLegacyPass(*PassRegistry::getPassRegistry()); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.addRequiredID(LoopSimplifyID); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - - AU.addPreserved(); - AU.addPreserved(); - AU.addPreserved(); - AU.addPreserved(); - } - - bool runOnFunction(Function &F) override { - if (skipFunction(F)) - return false; - - auto &LI = getAnalysis().getLoopInfo(); - auto &DT = getAnalysis().getDomTree(); - auto &DI = getAnalysis().getDI(); - auto &SE = getAnalysis().getSE(); - auto &PDT = getAnalysis().getPostDomTree(); - auto &ORE = getAnalysis().getORE(); - auto &AC = getAnalysis().getAssumptionCache(F); - const TargetTransformInfo &TTI = - getAnalysis().getTTI(F); - const DataLayout &DL = F.getParent()->getDataLayout(); - - LoopFuser LF(LI, DT, DI, SE, PDT, ORE, DL, AC, TTI); - return LF.fuseLoops(F); - } -}; } // namespace PreservedAnalyses LoopFusePass::run(Function &F, FunctionAnalysisManager &AM) { @@ -2142,19 +2097,3 @@ PreservedAnalyses LoopFusePass::run(Function &F, FunctionAnalysisManager &AM) { PA.preserve(); return PA; } - -char LoopFuseLegacy::ID = 0; - -INITIALIZE_PASS_BEGIN(LoopFuseLegacy, "loop-fusion", "Loop Fusion", false, - false) -INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass) -INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) -INITIALIZE_PASS_DEPENDENCY(DependenceAnalysisWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass) -INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass) -INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker) -INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass) -INITIALIZE_PASS_END(LoopFuseLegacy, "loop-fusion", "Loop Fusion", false, false) - -FunctionPass *llvm::createLoopFusePass() { return new LoopFuseLegacy(); } diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp index cff6b2f..467b36d6 100644 --- a/llvm/lib/Transforms/Scalar/Scalar.cpp +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp @@ -58,7 +58,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) { initializeDFAJumpThreadingLegacyPassPass(Registry); initializeLegacyLICMPassPass(Registry); initializeLegacyLoopSinkPassPass(Registry); - initializeLoopFuseLegacyPass(Registry); initializeLoopDataPrefetchLegacyPassPass(Registry); initializeLoopDeletionLegacyPassPass(Registry); initializeLoopAccessLegacyAnalysisPass(Registry);