[llvm] f9b523e - [Analysis] Remove unused class LegacyAARGetter
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed May 31 07:30:28 PDT 2023
Author: Kazu Hirata
Date: 2023-05-31T07:30:14-07:00
New Revision: f9b523ebc367f1535bf61797383471e567b24b75
URL: https://github.com/llvm/llvm-project/commit/f9b523ebc367f1535bf61797383471e567b24b75
DIFF: https://github.com/llvm/llvm-project/commit/f9b523ebc367f1535bf61797383471e567b24b75.diff
LOG: [Analysis] Remove unused class LegacyAARGetter
The last use was removed by:
commit fa6ea7a419f37befbed04368bcb8af4c718facbb
Author: Arthur Eubanks <aeubanks at google.com>
Date: Mon Mar 20 11:18:35 2023 -0700
Once we remove it, createLegacyPMAAResults and createLegacyPMAAResults
become unused, so this patch removes them as well.
Differential Revision: https://reviews.llvm.org/D151787
Added:
Modified:
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/include/llvm/Analysis/BasicAliasAnalysis.h
llvm/lib/Analysis/AliasAnalysis.cpp
llvm/lib/Analysis/BasicAliasAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 737aafcc3f60c..0b0c4b40ae2bd 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -985,15 +985,6 @@ FunctionPass *createAAResultsWrapperPass();
ImmutablePass *createExternalAAWrapperPass(
std::function<void(Pass &, Function &, AAResults &)> Callback);
-/// A helper for the legacy pass manager to create a \c AAResults
-/// object populated to the best of our ability for a particular function when
-/// inside of a \c ModulePass or a \c CallGraphSCCPass.
-///
-/// If a \c ModulePass or a \c CallGraphSCCPass calls \p
-/// createLegacyPMAAResults, it also needs to call \p addUsedAAAnalyses in \p
-/// getAnalysisUsage.
-AAResults createLegacyPMAAResults(Pass &P, Function &F, BasicAAResult &BAR);
-
} // end namespace llvm
#endif // LLVM_ANALYSIS_ALIASANALYSIS_H
diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index a2735f039a018..9d76e18bd4b48 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -176,28 +176,6 @@ class BasicAAWrapperPass : public FunctionPass {
FunctionPass *createBasicAAWrapperPass();
-/// A helper for the legacy pass manager to create a \c BasicAAResult object
-/// populated to the best of our ability for a particular function when inside
-/// of a \c ModulePass or a \c CallGraphSCCPass.
-BasicAAResult createLegacyPMBasicAAResult(Pass &P, Function &F);
-
-/// This class is a functor to be used in legacy module or SCC passes for
-/// computing AA results for a function. We store the results in fields so that
-/// they live long enough to be queried, but we re-use them each time.
-class LegacyAARGetter {
- Pass &P;
- std::optional<BasicAAResult> BAR;
- std::optional<AAResults> AAR;
-
-public:
- LegacyAARGetter(Pass &P) : P(P) {}
- AAResults &operator()(Function &F) {
- BAR.emplace(createLegacyPMBasicAAResult(P, F));
- AAR.emplace(createLegacyPMAAResults(P, F, *BAR));
- return *AAR;
- }
-};
-
} // end namespace llvm
#endif // LLVM_ANALYSIS_BASICALIASANALYSIS_H
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index cf1b11636efa5..de613406941c1 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -840,29 +840,6 @@ AAManager::Result AAManager::run(Function &F, FunctionAnalysisManager &AM) {
return R;
}
-AAResults llvm::createLegacyPMAAResults(Pass &P, Function &F,
- BasicAAResult &BAR) {
- AAResults AAR(P.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F));
-
- // Add in our explicitly constructed BasicAA results.
- if (!DisableBasicAA)
- AAR.addAAResult(BAR);
-
- // Populate the results with the other currently available AAs.
- if (auto *WrapperPass =
- P.getAnalysisIfAvailable<ScopedNoAliasAAWrapperPass>())
- AAR.addAAResult(WrapperPass->getResult());
- if (auto *WrapperPass = P.getAnalysisIfAvailable<TypeBasedAAWrapperPass>())
- AAR.addAAResult(WrapperPass->getResult());
- if (auto *WrapperPass = P.getAnalysisIfAvailable<GlobalsAAWrapperPass>())
- AAR.addAAResult(WrapperPass->getResult());
- if (auto *WrapperPass = P.getAnalysisIfAvailable<ExternalAAWrapperPass>())
- if (WrapperPass->CB)
- WrapperPass->CB(P, F, AAR);
-
- return AAR;
-}
-
bool llvm::isNoAliasCall(const Value *V) {
if (const auto *Call = dyn_cast<CallBase>(V))
return Call->hasRetAttr(Attribute::NoAlias);
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index f806e373d925a..5093166b59003 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -1827,10 +1827,3 @@ void BasicAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequiredTransitive<DominatorTreeWrapperPass>();
AU.addRequiredTransitive<TargetLibraryInfoWrapperPass>();
}
-
-BasicAAResult llvm::createLegacyPMBasicAAResult(Pass &P, Function &F) {
- return BasicAAResult(
- F.getParent()->getDataLayout(), F,
- P.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F),
- P.getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F));
-}
More information about the llvm-commits
mailing list