[llvm] 10eea3f - [LoopVersioning] Remove legacy pass
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 14 16:12:05 PST 2023
Author: Fangrui Song
Date: 2023-02-14T16:12:00-08:00
New Revision: 10eea3fe1536d5c8591d5ad47395345eb84e0201
URL: https://github.com/llvm/llvm-project/commit/10eea3fe1536d5c8591d5ad47395345eb84e0201
DIFF: https://github.com/llvm/llvm-project/commit/10eea3fe1536d5c8591d5ad47395345eb84e0201.diff
LOG: [LoopVersioning] Remove legacy pass
Following recent changes to remove non-core features of the legacy PM/optimization pipeline.
Added:
Modified:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Scalar/Scalar.cpp
llvm/lib/Transforms/Utils/LoopVersioning.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 39a5da542737..165d4d20ed03 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -226,7 +226,6 @@ void initializeLoopUnrollAndJamPass(PassRegistry&);
void initializeLoopUnrollPass(PassRegistry&);
void initializeLoopVectorizePass(PassRegistry&);
void initializeLoopVersioningLICMLegacyPassPass(PassRegistry &);
-void initializeLoopVersioningLegacyPassPass(PassRegistry &);
void initializeLowerAtomicLegacyPassPass(PassRegistry&);
void initializeLowerConstantIntrinsicsPass(PassRegistry&);
void initializeLowerEmuTLSPass(PassRegistry&);
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 1821fa683d96..3fdea7bc2826 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -484,12 +484,6 @@ FunctionPass *createNaryReassociatePass();
//
FunctionPass *createLoopFusePass();
-//===----------------------------------------------------------------------===//
-//
-// LoopVersioning - Perform loop multi-versioning.
-//
-FunctionPass *createLoopVersioningPass();
-
//===----------------------------------------------------------------------===//
//
// LoopDataPrefetch - Perform data prefetching in loops.
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index dd1343389d55..cd29c5eee2c7 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -105,7 +105,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializePlaceSafepointsPass(Registry);
initializeFloat2IntLegacyPassPass(Registry);
initializeLoopSimplifyCFGLegacyPassPass(Registry);
- initializeLoopVersioningLegacyPassPass(Registry);
}
void LLVMAddLoopSimplifyCFGPass(LLVMPassManagerRef PM) {
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 17e71cf5a6c4..cd4363dfbb42 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -31,6 +31,8 @@
using namespace llvm;
+#define DEBUG_TYPE "loop-versioning"
+
static cl::opt<bool>
AnnotateNoAlias("loop-version-annotate-no-alias", cl::init(true),
cl::Hidden,
@@ -290,56 +292,6 @@ bool runImpl(LoopInfo *LI, LoopAccessInfoManager &LAIs, DominatorTree *DT,
return Changed;
}
-
-/// Also expose this is a pass. Currently this is only used for
-/// unit-testing. It adds all memchecks necessary to remove all may-aliasing
-/// array accesses from the loop.
-class LoopVersioningLegacyPass : public FunctionPass {
-public:
- LoopVersioningLegacyPass() : FunctionPass(ID) {
- initializeLoopVersioningLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override {
- auto *LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
- auto &LAIs = getAnalysis<LoopAccessLegacyAnalysis>().getLAIs();
- auto *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- auto *SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
-
- return runImpl(LI, LAIs, DT, SE);
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.addRequired<LoopInfoWrapperPass>();
- AU.addPreserved<LoopInfoWrapperPass>();
- AU.addRequired<LoopAccessLegacyAnalysis>();
- AU.addRequired<DominatorTreeWrapperPass>();
- AU.addPreserved<DominatorTreeWrapperPass>();
- AU.addRequired<ScalarEvolutionWrapperPass>();
- }
-
- static char ID;
-};
-}
-
-#define LVER_OPTION "loop-versioning"
-#define DEBUG_TYPE LVER_OPTION
-
-char LoopVersioningLegacyPass::ID;
-static const char LVer_name[] = "Loop Versioning";
-
-INITIALIZE_PASS_BEGIN(LoopVersioningLegacyPass, LVER_OPTION, LVer_name, false,
- false)
-INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(LoopAccessLegacyAnalysis)
-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass)
-INITIALIZE_PASS_END(LoopVersioningLegacyPass, LVER_OPTION, LVer_name, false,
- false)
-
-namespace llvm {
-FunctionPass *createLoopVersioningLegacyPass() {
- return new LoopVersioningLegacyPass();
}
PreservedAnalyses LoopVersioningPass::run(Function &F,
@@ -353,4 +305,3 @@ PreservedAnalyses LoopVersioningPass::run(Function &F,
return PreservedAnalyses::none();
return PreservedAnalyses::all();
}
-} // namespace llvm
More information about the llvm-commits
mailing list