[llvm] 2470857 - [NewPM] Remove ScalarizerLegacyPass (#72814)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 20 01:09:31 PST 2023
Author: Aiden Grossman
Date: 2023-11-20T01:09:27-08:00
New Revision: 2470857fe701f41278dac33580ca8b0bdb38031f
URL: https://github.com/llvm/llvm-project/commit/2470857fe701f41278dac33580ca8b0bdb38031f
DIFF: https://github.com/llvm/llvm-project/commit/2470857fe701f41278dac33580ca8b0bdb38031f.diff
LOG: [NewPM] Remove ScalarizerLegacyPass (#72814)
This pass isn't used anywhere upstream and thus has no test coverage.
Because of these reasons, remove it.
Added:
Modified:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/include/llvm/Transforms/Scalar/Scalarizer.h
llvm/lib/Transforms/Scalar/Scalar.cpp
llvm/lib/Transforms/Scalar/Scalarizer.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 3047e2ed911a8ba..2305db4f775d49c 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -287,7 +287,6 @@ void initializeSafepointIRVerifierPass(PassRegistry&);
void initializeSelectOptimizePass(PassRegistry &);
void initializeScalarEvolutionWrapperPassPass(PassRegistry&);
void initializeScalarizeMaskedMemIntrinLegacyPassPass(PassRegistry &);
-void initializeScalarizerLegacyPassPass(PassRegistry&);
void initializeScavengerTestPass(PassRegistry&);
void initializeScopedNoAliasAAWrapperPassPass(PassRegistry&);
void initializeSeparateConstOffsetFromGEPLegacyPassPass(PassRegistry &);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index ea672b296c7b17e..0d15481034151df 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -136,7 +136,6 @@ namespace {
(void) llvm::createLowerAtomicPass();
(void) llvm::createLoadStoreVectorizerPass();
(void) llvm::createPartiallyInlineLibCallsPass();
- (void) llvm::createScalarizerPass();
(void) llvm::createSeparateConstOffsetFromGEPPass();
(void) llvm::createSpeculativeExecutionPass();
(void) llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
diff --git a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
index 5524b55b81b58a3..c2d9151b4971075 100644
--- a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
+++ b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
@@ -51,10 +51,6 @@ class ScalarizerPass : public PassInfoMixin<ScalarizerPass> {
void setScalarizeLoadStore(bool Value) { Options.ScalarizeLoadStore = Value; }
void setScalarizeMinBits(unsigned Value) { Options.ScalarizeMinBits = Value; }
};
-
-/// Create a legacy pass manager instance of the Scalarizer pass
-FunctionPass *createScalarizerPass();
-
}
#endif /* LLVM_TRANSFORMS_SCALAR_SCALARIZER_H */
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 9ba443ff905459b..80db06b03a901b3 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -21,7 +21,6 @@ using namespace llvm;
void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeConstantHoistingLegacyPassPass(Registry);
initializeDCELegacyPassPass(Registry);
- initializeScalarizerLegacyPassPass(Registry);
initializeLoopGuardWideningLegacyPassPass(Registry);
initializeGVNLegacyPassPass(Registry);
initializeEarlyCSELegacyPassPass(Registry);
diff --git a/llvm/lib/Transforms/Scalar/Scalarizer.cpp b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
index f5e480ae36bf42c..3eca9ac7c2673be 100644
--- a/llvm/lib/Transforms/Scalar/Scalarizer.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
@@ -36,8 +36,6 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
-#include "llvm/InitializePasses.h"
-#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/Local.h"
@@ -342,31 +340,8 @@ class ScalarizerVisitor : public InstVisitor<ScalarizerVisitor, bool> {
const unsigned ScalarizeMinBits;
};
-class ScalarizerLegacyPass : public FunctionPass {
-public:
- static char ID;
-
- ScalarizerLegacyPass() : FunctionPass(ID) {
- initializeScalarizerLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override;
-
- void getAnalysisUsage(AnalysisUsage& AU) const override {
- AU.addRequired<DominatorTreeWrapperPass>();
- AU.addPreserved<DominatorTreeWrapperPass>();
- }
-};
-
} // end anonymous namespace
-char ScalarizerLegacyPass::ID = 0;
-INITIALIZE_PASS_BEGIN(ScalarizerLegacyPass, "scalarizer",
- "Scalarize vector operations", false, false)
-INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_END(ScalarizerLegacyPass, "scalarizer",
- "Scalarize vector operations", false, false)
-
Scatterer::Scatterer(BasicBlock *bb, BasicBlock::iterator bbi, Value *v,
const VectorSplit &VS, ValueVector *cachePtr)
: BB(bb), BBI(bbi), V(v), VS(VS), CachePtr(cachePtr) {
@@ -439,19 +414,6 @@ Value *Scatterer::operator[](unsigned Frag) {
return CV[Frag];
}
-bool ScalarizerLegacyPass::runOnFunction(Function &F) {
- if (skipFunction(F))
- return false;
-
- DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- ScalarizerVisitor Impl(DT, ScalarizerPassOptions());
- return Impl.visit(F);
-}
-
-FunctionPass *llvm::createScalarizerPass() {
- return new ScalarizerLegacyPass();
-}
-
bool ScalarizerVisitor::visit(Function &F) {
assert(Gathered.empty() && Scattered.empty());
More information about the llvm-commits
mailing list