From f8d008d19f3553315ef481844f96249d0cccb1e6 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 4 Jan 2023 11:21:12 +0000 Subject: [PATCH] [ConstraintElim] Remove legacy pass implementation. The pass is exclusively used with the new pass manager now, so remove the legacy PM implementation. --- llvm/include/llvm/InitializePasses.h | 1 - llvm/include/llvm/Transforms/Scalar.h | 7 ---- .../Transforms/Scalar/ConstraintElimination.cpp | 40 ---------------------- llvm/lib/Transforms/Scalar/Scalar.cpp | 1 - 4 files changed, 49 deletions(-) diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index 8af87e6..8494692 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 0eebb63..3db3e41 100644 --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -342,13 +342,6 @@ FunctionPass *createConstantHoistingPass(); //===----------------------------------------------------------------------===// // -// ConstraintElimination - This pass eliminates conditions based on found -// constraints. -// -FunctionPass *createConstraintEliminationPass(); - -//===----------------------------------------------------------------------===// -// // Sink - Code Sinking // FunctionPass *createSinkingPass(); diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp index 5dee4d8..354796d 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 #include @@ -1053,41 +1051,3 @@ PreservedAnalyses ConstraintEliminationPass::run(Function &F, PA.preserveSet(); 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().getDomTree(); - return eliminateConstraints(F, DT); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.setPreservesCFG(); - AU.addRequired(); - AU.addPreserved(); - AU.addPreserved(); - } -}; - -} // 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 37153ea..8aee8d1 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); -- 2.7.4