-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[NewPM] Remove AAEval Legacy Pass #71358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NewPM] Remove AAEval Legacy Pass #71358
Conversation
@llvm/pr-subscribers-llvm-analysis Author: Aiden Grossman (boomanaiden154) ChangesThis patch removes the AAEval legacy pass and associated plumbing. This pass was migrated over to the new pass manager about 11 years ago at this point and there are currently no in-tree users of the legacy pass, so it's essentially just dead code and is completely untested. Full diff: https://github.com/llvm/llvm-project/pull/71358.diff 5 Files Affected:
diff --git a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
index 113115b871448b2..20bcbc592afbdbf 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
@@ -54,15 +54,8 @@ class AAEvaluator : public PassInfoMixin<AAEvaluator> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
private:
- // Allow the legacy pass to run this using an internal API.
- friend class AAEvalLegacyPass;
-
void runInternal(Function &F, AAResults &AA);
};
-
-/// Create a wrapper of the above for the legacy pass manager.
-FunctionPass *createAAEvalPass();
-
}
#endif
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index fafae8b5ecd7a7f..da38a38b87ebc4d 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -48,7 +48,6 @@ void initializeGlobalISel(PassRegistry&);
/// Initialize all passes linked into the CodeGen library.
void initializeTarget(PassRegistry&);
-void initializeAAEvalLegacyPassPass(PassRegistry&);
void initializeAAResultsWrapperPassPass(PassRegistry&);
void initializeAlwaysInlinerLegacyPassPass(PassRegistry&);
void initializeAssignmentTrackingAnalysisPass(PassRegistry &);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 141b5420b925ca8..0e61a7f413fe24e 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -61,7 +61,6 @@ namespace {
if (std::getenv("bar") != (char*) -1)
return;
- (void) llvm::createAAEvalPass();
(void) llvm::createBasicAAWrapperPass();
(void) llvm::createSCEVAAWrapperPass();
(void) llvm::createTypeBasedAAWrapperPass();
diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
index a551ea6b69c5a40..6bfba46f1e96fd0 100644
--- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -319,45 +319,3 @@ AAEvaluator::~AAEvaluator() {
<< "%/" << ModRefCount * 100 / ModRefSum << "%\n";
}
}
-
-namespace llvm {
-class AAEvalLegacyPass : public FunctionPass {
- std::unique_ptr<AAEvaluator> P;
-
-public:
- static char ID; // Pass identification, replacement for typeid
- AAEvalLegacyPass() : FunctionPass(ID) {
- initializeAAEvalLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.addRequired<AAResultsWrapperPass>();
- AU.setPreservesAll();
- }
-
- bool doInitialization(Module &M) override {
- P.reset(new AAEvaluator());
- return false;
- }
-
- bool runOnFunction(Function &F) override {
- P->runInternal(F, getAnalysis<AAResultsWrapperPass>().getAAResults());
- return false;
- }
- bool doFinalization(Module &M) override {
- P.reset();
- return false;
- }
-};
-}
-
-char AAEvalLegacyPass::ID = 0;
-INITIALIZE_PASS_BEGIN(AAEvalLegacyPass, "aa-eval",
- "Exhaustive Alias Analysis Precision Evaluator", false,
- true)
-INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
-INITIALIZE_PASS_END(AAEvalLegacyPass, "aa-eval",
- "Exhaustive Alias Analysis Precision Evaluator", false,
- true)
-
-FunctionPass *llvm::createAAEvalPass() { return new AAEvalLegacyPass(); }
diff --git a/llvm/lib/Analysis/Analysis.cpp b/llvm/lib/Analysis/Analysis.cpp
index 5461ce07af0b9f4..80ea80303644449 100644
--- a/llvm/lib/Analysis/Analysis.cpp
+++ b/llvm/lib/Analysis/Analysis.cpp
@@ -18,7 +18,6 @@ using namespace llvm;
/// initializeAnalysis - Initialize all passes linked into the Analysis library.
void llvm::initializeAnalysis(PassRegistry &Registry) {
- initializeAAEvalLegacyPassPass(Registry);
initializeBasicAAWrapperPassPass(Registry);
initializeBlockFrequencyInfoWrapperPassPass(Registry);
initializeBranchProbabilityInfoWrapperPassPass(Registry);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Removing a legacy pass usually involves ~5 files.
One thing people always forget when dropping support for legacy PM is to remove unneeded includes. I think that you no longer need (at least) these in AliasAnalysisEvaluator.cpp:
|
(Oops... I just wanted to Comment, but acccidentally pressed "Close with comment" instead of "Comment".) |
This patch removes the AAEval legacy pass and associated plumbing. This pass was migrated over to the new pass manager about 11 years ago at this point and there are currently no in-tree users of the legacy pass, so it's essentially just dead code.
b0eb183
to
556e8c3
Compare
Fixed in the latest revision. Thanks for catching this! |
This patch removes the AAEval legacy pass and associated plumbing. This pass was migrated over to the new pass manager about 11 years ago at this point and there are currently no in-tree users of the legacy pass, so it's essentially just dead code and is completely untested.