diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h --- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h +++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h @@ -789,38 +789,6 @@ FunctionAnalysisManager::Invalidator &Inv); }; -/// This analysis provides dependence information for the memory accesses -/// of a loop. -/// -/// It runs the analysis for a loop on demand. This can be initiated by -/// querying the loop access info via LAA::getInfo. getInfo return a -/// LoopAccessInfo object. See this class for the specifics of what information -/// is provided. -class LoopAccessLegacyAnalysis : public FunctionPass { -public: - static char ID; - - LoopAccessLegacyAnalysis(); - - bool runOnFunction(Function &F) override; - - void getAnalysisUsage(AnalysisUsage &AU) const override; - - /// Return the proxy object for retrieving LoopAccessInfo for individual - /// loops. - /// - /// If there is no cached result available run the analysis. - LoopAccessInfoManager &getLAIs() { return *LAIs; } - - void releaseMemory() override { - // Invalidate the cache when the pass is freed. - LAIs->clear(); - } - -private: - std::unique_ptr LAIs; -}; - /// This analysis provides dependence information for the memory /// accesses of a loop. /// 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 @@ -177,7 +177,6 @@ void initializeLoadStoreVectorizerLegacyPassPass(PassRegistry&); void initializeLocalStackSlotPassPass(PassRegistry&); void initializeLocalizerPass(PassRegistry&); -void initializeLoopAccessLegacyAnalysisPass(PassRegistry&); void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&); void initializeLoopExtractorLegacyPassPass(PassRegistry &); void initializeLoopGuardWideningLegacyPassPass(PassRegistry&); diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -2817,30 +2817,6 @@ return *I.first->second; } -LoopAccessLegacyAnalysis::LoopAccessLegacyAnalysis() : FunctionPass(ID) { - initializeLoopAccessLegacyAnalysisPass(*PassRegistry::getPassRegistry()); -} - -bool LoopAccessLegacyAnalysis::runOnFunction(Function &F) { - auto &SE = getAnalysis().getSE(); - auto *TLIP = getAnalysisIfAvailable(); - auto *TLI = TLIP ? &TLIP->getTLI(F) : nullptr; - auto &AA = getAnalysis().getAAResults(); - auto &DT = getAnalysis().getDomTree(); - auto &LI = getAnalysis().getLoopInfo(); - LAIs = std::make_unique(SE, AA, DT, LI, TLI); - return false; -} - -void LoopAccessLegacyAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredTransitive(); - AU.addRequiredTransitive(); - AU.addRequiredTransitive(); - AU.addRequiredTransitive(); - - AU.setPreservesAll(); -} - bool LoopAccessInfoManager::invalidate( Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv) { @@ -2869,23 +2845,4 @@ return LoopAccessInfoManager(SE, AA, DT, LI, &TLI); } -char LoopAccessLegacyAnalysis::ID = 0; -static const char laa_name[] = "Loop Access Analysis"; -#define LAA_NAME "loop-accesses" - -INITIALIZE_PASS_BEGIN(LoopAccessLegacyAnalysis, LAA_NAME, laa_name, false, true) -INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass) -INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass) -INITIALIZE_PASS_END(LoopAccessLegacyAnalysis, LAA_NAME, laa_name, false, true) - AnalysisKey LoopAccessAnalysis::Key; - -namespace llvm { - - Pass *createLAAPass() { - return new LoopAccessLegacyAnalysis(); - } - -} // end namespace llvm diff --git a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp --- a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp +++ b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp @@ -229,7 +229,6 @@ AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); - AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); } 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 @@ -34,7 +34,6 @@ initializeLegacyLICMPassPass(Registry); initializeLegacyLoopSinkPassPass(Registry); initializeLoopDataPrefetchLegacyPassPass(Registry); - initializeLoopAccessLegacyAnalysisPass(Registry); initializeLoopInstSimplifyLegacyPassPass(Registry); initializeLoopPredicationLegacyPassPass(Registry); initializeLoopRotateLegacyPassPass(Registry);