[llvm] f8d008d - [ConstraintElim] Remove legacy pass implementation.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 03:21:30 PST 2023
Author: Florian Hahn
Date: 2023-01-04T11:21:12Z
New Revision: f8d008d19f3553315ef481844f96249d0cccb1e6
URL: https://github.com/llvm/llvm-project/commit/f8d008d19f3553315ef481844f96249d0cccb1e6
DIFF: https://github.com/llvm/llvm-project/commit/f8d008d19f3553315ef481844f96249d0cccb1e6.diff
LOG: [ConstraintElim] Remove legacy pass implementation.
The pass is exclusively used with the new pass manager now, so remove
the legacy PM implementation.
Added:
Modified:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 8af87e69b0258..8494692f2a94e 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -94,7 +94,6 @@ void initializeCodeGenPreparePass(PassRegistry&);
void initializeComplexDeinterleavingLegacyPassPass(PassRegistry&);
void initializeConstantHoistingLegacyPassPass(PassRegistry&);
void initializeConstantMergeLegacyPassPass(PassRegistry&);
-void initializeConstraintEliminationPass(PassRegistry &);
void initializeCorrelatedValuePropagationPass(PassRegistry&);
void initializeCostModelAnalysisPass(PassRegistry&);
void initializeCrossDSOCFIPass(PassRegistry&);
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 0eebb63ce63fd..3db3e41d241a0 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -340,13 +340,6 @@ Pass *createLoopDeletionPass();
//
FunctionPass *createConstantHoistingPass();
-//===----------------------------------------------------------------------===//
-//
-// ConstraintElimination - This pass eliminates conditions based on found
-// constraints.
-//
-FunctionPass *createConstraintEliminationPass();
-
//===----------------------------------------------------------------------===//
//
// Sink - Code Sinking
diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index 5dee4d8a40cc4..354796d2f1391 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -26,12 +26,10 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PatternMatch.h"
-#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugCounter.h"
#include "llvm/Support/MathExtras.h"
-#include "llvm/Transforms/Scalar.h"
#include <cmath>
#include <string>
@@ -1053,41 +1051,3 @@ PreservedAnalyses ConstraintEliminationPass::run(Function &F,
PA.preserveSet<CFGAnalyses>();
return PA;
}
-
-namespace {
-
-class ConstraintElimination : public FunctionPass {
-public:
- static char ID;
-
- ConstraintElimination() : FunctionPass(ID) {
- initializeConstraintEliminationPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override {
- auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- return eliminateConstraints(F, DT);
- }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesCFG();
- AU.addRequired<DominatorTreeWrapperPass>();
- AU.addPreserved<GlobalsAAWrapperPass>();
- AU.addPreserved<DominatorTreeWrapperPass>();
- }
-};
-
-} // end anonymous namespace
-
-char ConstraintElimination::ID = 0;
-
-INITIALIZE_PASS_BEGIN(ConstraintElimination, "constraint-elimination",
- "Constraint Elimination", false, false)
-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(LazyValueInfoWrapperPass)
-INITIALIZE_PASS_END(ConstraintElimination, "constraint-elimination",
- "Constraint Elimination", false, false)
-
-FunctionPass *llvm::createConstraintEliminationPass() {
- return new ConstraintElimination();
-}
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 37153eac477e3..8aee8d140a295 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -35,7 +35,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeAlignmentFromAssumptionsPass(Registry);
initializeCallSiteSplittingLegacyPassPass(Registry);
initializeConstantHoistingLegacyPassPass(Registry);
- initializeConstraintEliminationPass(Registry);
initializeCorrelatedValuePropagationPass(Registry);
initializeDCELegacyPassPass(Registry);
initializeDivRemPairsLegacyPassPass(Registry);
More information about the llvm-commits
mailing list