[llvm] [NewPM] Remove Delinearization legacy pass (PR #72942)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 20 18:23:58 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-analysis
Author: Aiden Grossman (boomanaiden154)
<details>
<summary>Changes</summary>
This pass isn't used/tested anywhere in upstream LLVM, so remove it.
---
Full diff: https://github.com/llvm/llvm-project/pull/72942.diff
4 Files Affected:
- (modified) llvm/include/llvm/Analysis/Passes.h (-7)
- (modified) llvm/include/llvm/InitializePasses.h (-1)
- (modified) llvm/lib/Analysis/Analysis.cpp (-1)
- (modified) llvm/lib/Analysis/Delinearization.cpp (-46)
``````````diff
diff --git a/llvm/include/llvm/Analysis/Passes.h b/llvm/include/llvm/Analysis/Passes.h
index ac1bc3549910c8c..58f425f43aec670 100644
--- a/llvm/include/llvm/Analysis/Passes.h
+++ b/llvm/include/llvm/Analysis/Passes.h
@@ -39,13 +39,6 @@ namespace llvm {
//
FunctionPass *createCostModelAnalysisPass();
- //===--------------------------------------------------------------------===//
- //
- // createDelinearizationPass - This pass implements attempts to restore
- // multidimensional array indices from linearized expressions.
- //
- FunctionPass *createDelinearizationPass();
-
//===--------------------------------------------------------------------===//
//
// Minor pass prototypes, allowing us to expose them through bugpoint and
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 2305db4f775d49c..5f2b397435dee9e 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -90,7 +90,6 @@ void initializeDAHPass(PassRegistry&);
void initializeDCELegacyPassPass(PassRegistry&);
void initializeDeadMachineInstructionElimPass(PassRegistry&);
void initializeDebugifyMachineModulePass(PassRegistry &);
-void initializeDelinearizationPass(PassRegistry&);
void initializeDependenceAnalysisWrapperPassPass(PassRegistry&);
void initializeDetectDeadLanesPass(PassRegistry&);
void initializeDomOnlyPrinterWrapperPassPass(PassRegistry &);
diff --git a/llvm/lib/Analysis/Analysis.cpp b/llvm/lib/Analysis/Analysis.cpp
index 80ea80303644449..b3c11873947267b 100644
--- a/llvm/lib/Analysis/Analysis.cpp
+++ b/llvm/lib/Analysis/Analysis.cpp
@@ -32,7 +32,6 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
initializeCFGOnlyPrinterLegacyPassPass(Registry);
initializeCycleInfoWrapperPassPass(Registry);
initializeDependenceAnalysisWrapperPassPass(Registry);
- initializeDelinearizationPass(Registry);
initializeDominanceFrontierWrapperPassPass(Registry);
initializeDomViewerWrapperPassPass(Registry);
initializeDomPrinterWrapperPassPass(Registry);
diff --git a/llvm/lib/Analysis/Delinearization.cpp b/llvm/lib/Analysis/Delinearization.cpp
index 7ab91b9eaea4ed9..a45d8815e54ce9c 100644
--- a/llvm/lib/Analysis/Delinearization.cpp
+++ b/llvm/lib/Analysis/Delinearization.cpp
@@ -25,8 +25,6 @@
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PassManager.h"
-#include "llvm/InitializePasses.h"
-#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
@@ -561,24 +559,6 @@ bool llvm::tryDelinearizeFixedSizeImpl(
namespace {
-class Delinearization : public FunctionPass {
- Delinearization(const Delinearization &); // do not implement
-protected:
- Function *F;
- LoopInfo *LI;
- ScalarEvolution *SE;
-
-public:
- static char ID; // Pass identification, replacement for typeid
-
- Delinearization() : FunctionPass(ID) {
- initializeDelinearizationPass(*PassRegistry::getPassRegistry());
- }
- bool runOnFunction(Function &F) override;
- void getAnalysisUsage(AnalysisUsage &AU) const override;
- void print(raw_ostream &O, const Module *M = nullptr) const override;
-};
-
void printDelinearization(raw_ostream &O, Function *F, LoopInfo *LI,
ScalarEvolution *SE) {
O << "Delinearization on function " << F->getName() << ":\n";
@@ -631,32 +611,6 @@ void printDelinearization(raw_ostream &O, Function *F, LoopInfo *LI,
} // end anonymous namespace
-void Delinearization::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<LoopInfoWrapperPass>();
- AU.addRequired<ScalarEvolutionWrapperPass>();
-}
-
-bool Delinearization::runOnFunction(Function &F) {
- this->F = &F;
- SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
- LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
- return false;
-}
-
-void Delinearization::print(raw_ostream &O, const Module *) const {
- printDelinearization(O, F, LI, SE);
-}
-
-char Delinearization::ID = 0;
-static const char delinearization_name[] = "Delinearization";
-INITIALIZE_PASS_BEGIN(Delinearization, DL_NAME, delinearization_name, true,
- true)
-INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
-INITIALIZE_PASS_END(Delinearization, DL_NAME, delinearization_name, true, true)
-
-FunctionPass *llvm::createDelinearizationPass() { return new Delinearization; }
-
DelinearizationPrinterPass::DelinearizationPrinterPass(raw_ostream &OS)
: OS(OS) {}
PreservedAnalyses DelinearizationPrinterPass::run(Function &F,
``````````
</details>
https://github.com/llvm/llvm-project/pull/72942
More information about the llvm-commits
mailing list