[llvm] [NewPM] Remove InstCountLegacyPass (PR #72936)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 20 17:18:42 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 upstream, so remove it.
---
Full diff: https://github.com/llvm/llvm-project/pull/72936.diff
5 Files Affected:
- (modified) llvm/include/llvm/Analysis/Passes.h (-6)
- (modified) llvm/include/llvm/InitializePasses.h (-1)
- (modified) llvm/include/llvm/LinkAllPasses.h (-1)
- (modified) llvm/lib/Analysis/Analysis.cpp (-1)
- (modified) llvm/lib/Analysis/InstCount.cpp (-31)
``````````diff
diff --git a/llvm/include/llvm/Analysis/Passes.h b/llvm/include/llvm/Analysis/Passes.h
index ac1bc3549910c8c..a8a86da1207020f 100644
--- a/llvm/include/llvm/Analysis/Passes.h
+++ b/llvm/include/llvm/Analysis/Passes.h
@@ -46,12 +46,6 @@ namespace llvm {
//
FunctionPass *createDelinearizationPass();
- //===--------------------------------------------------------------------===//
- //
- // Minor pass prototypes, allowing us to expose them through bugpoint and
- // analyze.
- FunctionPass *createInstCountPass();
-
//===--------------------------------------------------------------------===//
//
// createRegionInfoPass - This pass finds all single entry single exit regions
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 2305db4f775d49c..e42ba3882481c8f 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -139,7 +139,6 @@ void initializeImmutableModuleSummaryIndexWrapperPassPass(PassRegistry&);
void initializeImplicitNullChecksPass(PassRegistry&);
void initializeIndirectBrExpandPassPass(PassRegistry&);
void initializeInferAddressSpacesPass(PassRegistry&);
-void initializeInstCountLegacyPassPass(PassRegistry &);
void initializeInstSimplifyLegacyPassPass(PassRegistry &);
void initializeInstructionCombiningPassPass(PassRegistry&);
void initializeInstructionSelectPass(PassRegistry&);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 0d15481034151df..fde484dfdf17b50 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -118,7 +118,6 @@ namespace {
(void) llvm::createSingleLoopExtractorPass();
(void) llvm::createTailCallEliminationPass();
(void)llvm::createTLSVariableHoistPass();
- (void) llvm::createInstCountPass();
(void) llvm::createConstantHoistingPass();
(void) llvm::createCodeGenPreparePass();
(void) llvm::createEarlyCSEPass();
diff --git a/llvm/lib/Analysis/Analysis.cpp b/llvm/lib/Analysis/Analysis.cpp
index 80ea80303644449..a7b4a001a28bdea 100644
--- a/llvm/lib/Analysis/Analysis.cpp
+++ b/llvm/lib/Analysis/Analysis.cpp
@@ -45,7 +45,6 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
initializeAAResultsWrapperPassPass(Registry);
initializeGlobalsAAWrapperPassPass(Registry);
initializeIVUsersWrapperPassPass(Registry);
- initializeInstCountLegacyPassPass(Registry);
initializeIntervalPartitionPass(Registry);
initializeIRSimilarityIdentifierWrapperPassPass(Registry);
initializeLazyBranchProbabilityInfoPassPass(Registry);
diff --git a/llvm/lib/Analysis/InstCount.cpp b/llvm/lib/Analysis/InstCount.cpp
index 8366bee083f225b..d427d3eeaa9e168 100644
--- a/llvm/lib/Analysis/InstCount.cpp
+++ b/llvm/lib/Analysis/InstCount.cpp
@@ -15,8 +15,6 @@
#include "llvm/Analysis/Passes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstVisitor.h"
-#include "llvm/InitializePasses.h"
-#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
@@ -63,32 +61,3 @@ PreservedAnalyses InstCountPass::run(Function &F,
return PreservedAnalyses::all();
}
-
-namespace {
-class InstCountLegacyPass : public FunctionPass {
-public:
- static char ID; // Pass identification, replacement for typeid
- InstCountLegacyPass() : FunctionPass(ID) {
- initializeInstCountLegacyPassPass(*PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override {
- LLVM_DEBUG(dbgs() << "INSTCOUNT: running on function " << F.getName()
- << "\n");
- InstCount().visit(F);
- return false;
- };
-
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesAll();
- }
-
- void print(raw_ostream &O, const Module *M) const override {}
-};
-} // namespace
-
-char InstCountLegacyPass::ID = 0;
-INITIALIZE_PASS(InstCountLegacyPass, "instcount",
- "Counts the various types of Instructions", false, true)
-
-FunctionPass *llvm::createInstCountPass() { return new InstCountLegacyPass(); }
``````````
</details>
https://github.com/llvm/llvm-project/pull/72936
More information about the llvm-commits
mailing list