[llvm] 4eee778 - [LoopReroll] Remove legacy pass (unused in the pipeline)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 16:09:38 PST 2023
Author: Fangrui Song
Date: 2023-02-15T16:09:32-08:00
New Revision: 4eee77873bcac7d4a94b88feaa8e2c571e0dba6e
URL: https://github.com/llvm/llvm-project/commit/4eee77873bcac7d4a94b88feaa8e2c571e0dba6e
DIFF: https://github.com/llvm/llvm-project/commit/4eee77873bcac7d4a94b88feaa8e2c571e0dba6e.diff
LOG: [LoopReroll] Remove legacy pass (unused in the pipeline)
Following recent changes to remove non-core legacy passes.
Added:
Modified:
llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
llvm/include/llvm-c/Transforms/Scalar.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp
llvm/test/Bindings/OCaml/scalar_opts.ml
Removed:
################################################################################
diff --git a/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml b/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
index 5da7fc394e4d3..9feb6b4143551 100644
--- a/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
+++ b/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
@@ -51,9 +51,6 @@ external add_loop_idiom
external add_loop_rotation
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_loop_rotate"
-external add_loop_reroll
- : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
- = "llvm_add_loop_reroll"
external add_loop_unroll
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_loop_unroll"
diff --git a/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli b/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
index afd28baeca816..8d22a6861a3fd 100644
--- a/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
+++ b/llvm/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
@@ -86,11 +86,6 @@ external add_loop_rotation
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_loop_rotate"
-(** See the [llvm::createLoopRerollPass] function. *)
-external add_loop_reroll
- : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
- = "llvm_add_loop_reroll"
-
(** See the [llvm::createLoopUnrollPass] function. *)
external add_loop_unroll
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
diff --git a/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c b/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
index 7adc2266346e6..cdb5f3de932b9 100644
--- a/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
+++ b/llvm/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
@@ -109,12 +109,6 @@ value llvm_add_loop_rotate(LLVMPassManagerRef PM) {
return Val_unit;
}
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-value llvm_add_loop_reroll(LLVMPassManagerRef PM) {
- LLVMAddLoopRerollPass(PM);
- return Val_unit;
-}
-
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
LLVMAddLoopUnrollPass(PM);
diff --git a/llvm/include/llvm-c/Transforms/Scalar.h b/llvm/include/llvm-c/Transforms/Scalar.h
index 2fede0a104c60..e28b1d7d401e4 100644
--- a/llvm/include/llvm-c/Transforms/Scalar.h
+++ b/llvm/include/llvm-c/Transforms/Scalar.h
@@ -85,9 +85,6 @@ void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
/** See llvm::createLoopRotatePass function. */
void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
-/** See llvm::createLoopRerollPass function. */
-void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
-
/** See llvm::createLoopUnrollPass function. */
void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index b3b58d6a203d1..7a1011c33e0fe 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -214,7 +214,6 @@ void initializeLoopInfoWrapperPassPass(PassRegistry&);
void initializeLoopInstSimplifyLegacyPassPass(PassRegistry&);
void initializeLoopPassPass(PassRegistry&);
void initializeLoopPredicationLegacyPassPass(PassRegistry&);
-void initializeLoopRerollLegacyPassPass(PassRegistry &);
void initializeLoopRotateLegacyPassPass(PassRegistry&);
void initializeLoopSimplifyCFGLegacyPassPass(PassRegistry&);
void initializeLoopSimplifyPass(PassRegistry&);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 335460f700af8..0b499433c2107 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -112,7 +112,6 @@ namespace {
(void) llvm::createLoopSimplifyPass();
(void) llvm::createLoopSimplifyCFGPass();
(void) llvm::createLoopStrengthReducePass();
- (void) llvm::createLoopRerollPass();
(void) llvm::createLoopUnrollPass();
(void) llvm::createLoopIdiomPass();
(void) llvm::createLoopRotatePass();
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 44d57f21a3f1d..3bc0000916049 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -170,12 +170,6 @@ Pass *createLoopUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false,
Pass *createSimpleLoopUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false,
bool ForgetAllSCEV = false);
-//===----------------------------------------------------------------------===//
-//
-// LoopReroll - This pass is a simple loop rerolling pass.
-//
-Pass *createLoopRerollPass();
-
//===----------------------------------------------------------------------===//
//
// LoopRotate - This pass is a simple loop rotating pass.
diff --git a/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp b/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
index a0b3189c7e097..8dc58b1b48c6b 100644
--- a/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
@@ -157,22 +157,6 @@ namespace {
IL_End
};
- class LoopRerollLegacyPass : public LoopPass {
- public:
- static char ID; // Pass ID, replacement for typeid
-
- LoopRerollLegacyPass() : LoopPass(ID) {
- initializeLoopRerollLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnLoop(Loop *L, LPPassManager &LPM) override;
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.addRequired<TargetLibraryInfoWrapperPass>();
- getLoopAnalysisUsage(AU);
- }
- };
-
class LoopReroll {
public:
LoopReroll(AliasAnalysis *AA, LoopInfo *LI, ScalarEvolution *SE,
@@ -490,17 +474,6 @@ namespace {
} // end anonymous namespace
-char LoopRerollLegacyPass::ID = 0;
-
-INITIALIZE_PASS_BEGIN(LoopRerollLegacyPass, "loop-reroll", "Reroll loops",
- false, false)
-INITIALIZE_PASS_DEPENDENCY(LoopPass)
-INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
-INITIALIZE_PASS_END(LoopRerollLegacyPass, "loop-reroll", "Reroll loops", false,
- false)
-
-Pass *llvm::createLoopRerollPass() { return new LoopRerollLegacyPass; }
-
// Returns true if the provided instruction is used outside the given loop.
// This operates like Instruction::isUsedOutsideOfBlock, but considers PHIs in
// non-loop blocks to be outside the loop.
@@ -1700,21 +1673,6 @@ bool LoopReroll::runOnLoop(Loop *L) {
return Changed;
}
-bool LoopRerollLegacyPass::runOnLoop(Loop *L, LPPassManager &LPM) {
- if (skipLoop(L))
- return false;
-
- auto *AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
- auto *LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
- auto *SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
- auto *TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
- *L->getHeader()->getParent());
- auto *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
-
- return LoopReroll(AA, LI, SE, TLI, DT, PreserveLCSSA).runOnLoop(L);
-}
-
PreservedAnalyses LoopRerollPass::run(Loop &L, LoopAnalysisManager &AM,
LoopStandardAnalysisResults &AR,
LPMUpdater &U) {
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index aa4dd61c49749..a718aefe7bbaf 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -65,7 +65,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeLoopPredicationLegacyPassPass(Registry);
initializeLoopRotateLegacyPassPass(Registry);
initializeLoopStrengthReducePass(Registry);
- initializeLoopRerollLegacyPassPass(Registry);
initializeLoopUnrollPass(Registry);
initializeLoopIdiomRecognizeLegacyPassPass(Registry);
initializeLowerAtomicLegacyPassPass(Registry);
@@ -182,10 +181,6 @@ void LLVMAddLoopRotatePass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createLoopRotatePass());
}
-void LLVMAddLoopRerollPass(LLVMPassManagerRef PM) {
- unwrap(PM)->add(createLoopRerollPass());
-}
-
void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createLoopUnrollPass());
}
diff --git a/llvm/test/Bindings/OCaml/scalar_opts.ml b/llvm/test/Bindings/OCaml/scalar_opts.ml
index 31eca283ad19d..f9755466276c7 100644
--- a/llvm/test/Bindings/OCaml/scalar_opts.ml
+++ b/llvm/test/Bindings/OCaml/scalar_opts.ml
@@ -56,7 +56,6 @@ let test_transforms () =
++ add_loop_deletion
++ add_loop_idiom
++ add_loop_rotation
- ++ add_loop_reroll
++ add_loop_unroll
++ add_memcpy_opt
++ add_partially_inline_lib_calls
More information about the llvm-commits
mailing list