[llvm] 95a204c - [CodeGenPassBuilder] Remove analysis registering interfaces (#81439)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 18:49:02 PST 2024
Author: paperchalice
Date: 2024-02-13T10:48:58+08:00
New Revision: 95a204cf34c410c2be5f152daec2d476f1e06d84
URL: https://github.com/llvm/llvm-project/commit/95a204cf34c410c2be5f152daec2d476f1e06d84
DIFF: https://github.com/llvm/llvm-project/commit/95a204cf34c410c2be5f152daec2d476f1e06d84.diff
LOG: [CodeGenPassBuilder] Remove analysis registering interfaces (#81439)
PassBuilder already can do this.
Added:
Modified:
llvm/include/llvm/Passes/CodeGenPassBuilder.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
index fa6dbd4a49730e..80bbfb75185a9c 100644
--- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
@@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//
/// \file
///
-/// Interfaces for registering analysis passes, producing common pass manager
-/// configurations, and parsing of pass pipelines.
+/// Interfaces for producing common pass manager configurations.
///
//===----------------------------------------------------------------------===//
@@ -137,16 +136,6 @@ template <typename DerivedT> class CodeGenPassBuilder {
raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
CodeGenFileType FileType) const;
- void registerModuleAnalyses(ModuleAnalysisManager &) const;
- void registerFunctionAnalyses(FunctionAnalysisManager &) const;
- void registerMachineFunctionAnalyses(MachineFunctionAnalysisManager &) const;
-
- void registerAnalyses(MachineFunctionAnalysisManager &MFAM) const {
- registerModuleAnalyses(*MFAM.MAM);
- registerFunctionAnalyses(*MFAM.FAM);
- registerMachineFunctionAnalyses(MFAM);
- }
-
PassInstrumentationCallbacks *getPassInstrumentationCallbacks() const {
return PIC;
}
@@ -239,14 +228,6 @@ template <typename DerivedT> class CodeGenPassBuilder {
CGPassBuilderOption Opt;
PassInstrumentationCallbacks *PIC;
- /// Target override these hooks to parse target-specific analyses.
- void registerTargetAnalysis(ModuleAnalysisManager &) const {}
- void registerTargetAnalysis(FunctionAnalysisManager &) const {}
- void registerTargetAnalysis(MachineFunctionAnalysisManager &) const {}
- std::pair<StringRef, bool> getTargetPassNameFromLegacyName(StringRef) const {
- return {"", false};
- }
-
template <typename TMC> TMC &getTM() const { return static_cast<TMC &>(TM); }
CodeGenOptLevel getOptLevel() const { return TM.getOptLevel(); }
@@ -577,52 +558,6 @@ Error CodeGenPassBuilder<Derived>::verifyStartStop(
return Error::success();
}
-static inline AAManager registerAAAnalyses() {
- AAManager AA;
-
- // The order in which these are registered determines their priority when
- // being queried.
-
- // Basic AliasAnalysis support.
- // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
- // BasicAliasAnalysis wins if they disagree. This is intended to help
- // support "obvious" type-punning idioms.
- AA.registerFunctionAnalysis<TypeBasedAA>();
- AA.registerFunctionAnalysis<ScopedNoAliasAA>();
- AA.registerFunctionAnalysis<BasicAA>();
-
- return AA;
-}
-
-template <typename Derived>
-void CodeGenPassBuilder<Derived>::registerModuleAnalyses(
- ModuleAnalysisManager &MAM) const {
-#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
- MAM.registerPass([&] { return CREATE_PASS; });
-#include "MachinePassRegistry.def"
- derived().registerTargetAnalysis(MAM);
-}
-
-template <typename Derived>
-void CodeGenPassBuilder<Derived>::registerFunctionAnalyses(
- FunctionAnalysisManager &FAM) const {
- FAM.registerPass([this] { return registerAAAnalyses(); });
-
-#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
- FAM.registerPass([&] { return CREATE_PASS; });
-#include "MachinePassRegistry.def"
- derived().registerTargetAnalysis(FAM);
-}
-
-template <typename Derived>
-void CodeGenPassBuilder<Derived>::registerMachineFunctionAnalyses(
- MachineFunctionAnalysisManager &MFAM) const {
-#define MACHINE_FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
- MFAM.registerPass([&] { return CREATE_PASS; });
-#include "MachinePassRegistry.def"
- derived().registerTargetAnalysis(MFAM);
-}
-
template <typename Derived>
void CodeGenPassBuilder<Derived>::addISelPasses(AddIRPass &addPass) const {
derived().addGlobalMergePass(addPass);
More information about the llvm-commits
mailing list