[llvm] ef09abf - [InstCombine] Remove unused function createInstructionCombiningPass
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 11 07:56:44 PDT 2023
Author: Kazu Hirata
Date: 2023-06-11T07:56:37-07:00
New Revision: ef09abfcf4a0253ea2d7cbd4ecd6535a89c747ab
URL: https://github.com/llvm/llvm-project/commit/ef09abfcf4a0253ea2d7cbd4ecd6535a89c747ab
DIFF: https://github.com/llvm/llvm-project/commit/ef09abfcf4a0253ea2d7cbd4ecd6535a89c747ab.diff
LOG: [InstCombine] Remove unused function createInstructionCombiningPass
The last use was removed by:
commit 934c82d31801e65aa3bbe99a0e64f903621c2e04
Author: Florian Hahn <flo at fhahn.com>
Date: Fri Feb 24 13:39:32 2023 +0100
Once I remove createInstructionCombiningPass, then:
InstructionCombiningPass::InstructionCombiningPass(unsigned MaxIterations)
becomes unused. Once I remove that:
InstructionCombiningPass::MaxIterations is always initialized with
InstCombineDefaultMaxIterations, so this patch does the constant
propagation and removes InstructionCombiningPass::MaxIterations as
well.
Differential Revision: https://reviews.llvm.org/D152641
Added:
Modified:
llvm/include/llvm/Transforms/InstCombine/InstCombine.h
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
index 557d0a4c30d62..3e1c6e0fcdc6a 100644
--- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
+++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
@@ -63,13 +63,11 @@ class InstCombinePass : public PassInfoMixin<InstCombinePass> {
/// will try to combine all instructions in the function.
class InstructionCombiningPass : public FunctionPass {
InstructionWorklist Worklist;
- const unsigned MaxIterations;
public:
static char ID; // Pass identification, replacement for typeid
explicit InstructionCombiningPass();
- explicit InstructionCombiningPass(unsigned MaxIterations);
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnFunction(Function &F) override;
@@ -88,7 +86,6 @@ class InstructionCombiningPass : public FunctionPass {
// %Z = add int 2, %X
//
FunctionPass *createInstructionCombiningPass();
-FunctionPass *createInstructionCombiningPass(unsigned MaxIterations);
}
#undef DEBUG_TYPE
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 6254112adf466..905f9c3786748 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -4161,18 +4161,13 @@ bool InstructionCombiningPass::runOnFunction(Function &F) {
nullptr;
return combineInstructionsOverFunction(F, Worklist, AA, AC, TLI, TTI, DT, ORE,
- BFI, PSI, MaxIterations, LI);
+ BFI, PSI,
+ InstCombineDefaultMaxIterations, LI);
}
char InstructionCombiningPass::ID = 0;
-InstructionCombiningPass::InstructionCombiningPass()
- : FunctionPass(ID), MaxIterations(InstCombineDefaultMaxIterations) {
- initializeInstructionCombiningPassPass(*PassRegistry::getPassRegistry());
-}
-
-InstructionCombiningPass::InstructionCombiningPass(unsigned MaxIterations)
- : FunctionPass(ID), MaxIterations(MaxIterations) {
+InstructionCombiningPass::InstructionCombiningPass() : FunctionPass(ID) {
initializeInstructionCombiningPassPass(*PassRegistry::getPassRegistry());
}
@@ -4198,7 +4193,3 @@ void llvm::initializeInstCombine(PassRegistry &Registry) {
FunctionPass *llvm::createInstructionCombiningPass() {
return new InstructionCombiningPass();
}
-
-FunctionPass *llvm::createInstructionCombiningPass(unsigned MaxIterations) {
- return new InstructionCombiningPass(MaxIterations);
-}
More information about the llvm-commits
mailing list