[llvm] [NewPM] Remove MergedLoadStoreMotionLegacyPass (PR #72813)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 19 16:04:36 PST 2023
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/72813
This pass isn't used anywhere and thus isn't tested anywhere. Because of these reasons, remove it.
>From 54027cf7e4011e72267fc0e894bb5c60f9017175 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Sun, 19 Nov 2023 16:03:22 -0800
Subject: [PATCH] [NewPM] Remove MergedLoadStoreMotionLegacyPass
This pass isn't used anywhere and thus isn't tested anywhere. Because of
these reasons, remove it.
---
llvm/include/llvm/InitializePasses.h | 1 -
llvm/include/llvm/LinkAllPasses.h | 1 -
llvm/include/llvm/Transforms/Scalar.h | 7 ---
.../Scalar/MergedLoadStoreMotion.cpp | 47 -------------------
llvm/lib/Transforms/Scalar/Scalar.cpp | 1 -
5 files changed, 57 deletions(-)
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index da38a38b87ebc4d..77632c9486c7dd9 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -231,7 +231,6 @@ void initializeMachineVerifierPassPass(PassRegistry&);
void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
void initializeMemorySSAWrapperPassPass(PassRegistry&);
void initializeMergeICmpsLegacyPassPass(PassRegistry &);
-void initializeMergedLoadStoreMotionLegacyPassPass(PassRegistry&);
void initializeModuleSummaryIndexWrapperPassPass(PassRegistry&);
void initializeModuloScheduleTestPass(PassRegistry&);
void initializeNaryReassociateLegacyPassPass(PassRegistry&);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 3fc90e85c3533e2..3314ab51bb86338 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -126,7 +126,6 @@ namespace {
(void) llvm::createConstantHoistingPass();
(void) llvm::createCodeGenPreparePass();
(void) llvm::createEarlyCSEPass();
- (void) llvm::createMergedLoadStoreMotionPass();
(void) llvm::createGVNPass();
(void) llvm::createPostDomTree();
(void) llvm::createMergeICmpsLegacyPass();
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 0676f485f3fbcf4..a4672c7a184064d 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -170,13 +170,6 @@ FunctionPass *createTailCallEliminationPass();
//
FunctionPass *createEarlyCSEPass(bool UseMemorySSA = false);
-//===----------------------------------------------------------------------===//
-//
-// MergedLoadStoreMotion - This pass merges loads and stores in diamonds. Loads
-// are hoisted into the header, while stores sink into the footer.
-//
-FunctionPass *createMergedLoadStoreMotionPass(bool SplitFooterBB = false);
-
//===----------------------------------------------------------------------===//
//
// ConstantHoisting - This pass prepares a function for expensive constants.
diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
index 3c0f2010d1edf4c..d65054a6ff9d5fa 100644
--- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
+++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
@@ -80,7 +80,6 @@
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
@@ -378,52 +377,6 @@ bool MergedLoadStoreMotion::run(Function &F, AliasAnalysis &AA) {
return Changed;
}
-namespace {
-class MergedLoadStoreMotionLegacyPass : public FunctionPass {
- const bool SplitFooterBB;
-public:
- static char ID; // Pass identification, replacement for typeid
- MergedLoadStoreMotionLegacyPass(bool SplitFooterBB = false)
- : FunctionPass(ID), SplitFooterBB(SplitFooterBB) {
- initializeMergedLoadStoreMotionLegacyPassPass(
- *PassRegistry::getPassRegistry());
- }
-
- ///
- /// Run the transformation for each function
- ///
- bool runOnFunction(Function &F) override {
- if (skipFunction(F))
- return false;
- MergedLoadStoreMotion Impl(SplitFooterBB);
- return Impl.run(F, getAnalysis<AAResultsWrapperPass>().getAAResults());
- }
-
-private:
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- if (!SplitFooterBB)
- AU.setPreservesCFG();
- AU.addRequired<AAResultsWrapperPass>();
- AU.addPreserved<GlobalsAAWrapperPass>();
- }
-};
-
-char MergedLoadStoreMotionLegacyPass::ID = 0;
-} // anonymous namespace
-
-///
-/// createMergedLoadStoreMotionPass - The public interface to this file.
-///
-FunctionPass *llvm::createMergedLoadStoreMotionPass(bool SplitFooterBB) {
- return new MergedLoadStoreMotionLegacyPass(SplitFooterBB);
-}
-
-INITIALIZE_PASS_BEGIN(MergedLoadStoreMotionLegacyPass, "mldst-motion",
- "MergedLoadStoreMotion", false, false)
-INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
-INITIALIZE_PASS_END(MergedLoadStoreMotionLegacyPass, "mldst-motion",
- "MergedLoadStoreMotion", false, false)
-
PreservedAnalyses
MergedLoadStoreMotionPass::run(Function &F, FunctionAnalysisManager &AM) {
MergedLoadStoreMotion Impl(Options.SplitFooterBB);
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 11bb8e936b74e7c..cf90488bfe60fc1 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -43,7 +43,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeLowerConstantIntrinsicsPass(Registry);
initializeLowerWidenableConditionLegacyPassPass(Registry);
initializeMergeICmpsLegacyPassPass(Registry);
- initializeMergedLoadStoreMotionLegacyPassPass(Registry);
initializeNaryReassociateLegacyPassPass(Registry);
initializePartiallyInlineLibCallsLegacyPassPass(Registry);
initializeReassociateLegacyPassPass(Registry);
More information about the llvm-commits
mailing list