[llvm] [NFC][LLVM][SystemZ] Cleanup pass initialization for SystemZ (PR #134450)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 16:16:22 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-systemz

Author: Rahul Joshi (jurahul)

<details>
<summary>Changes</summary>

- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767

---
Full diff: https://github.com/llvm/llvm-project/pull/134450.diff


7 Files Affected:

- (modified) llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp (+1-4) 
- (modified) llvm/lib/Target/SystemZ/SystemZElimCompare.cpp (+1-3) 
- (modified) llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp (+1-3) 
- (modified) llvm/lib/Target/SystemZ/SystemZLongBranch.cpp (+1-3) 
- (modified) llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp (+1-3) 
- (modified) llvm/lib/Target/SystemZ/SystemZShortenInst.cpp (+1-3) 
- (modified) llvm/lib/Target/SystemZ/SystemZTDC.cpp (+1-3) 


``````````diff
diff --git a/llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp b/llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp
index a6cf0f57aaf06..8867b6ea10931 100644
--- a/llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp
@@ -28,10 +28,7 @@ namespace {
 class SystemZCopyPhysRegs : public MachineFunctionPass {
 public:
   static char ID;
-  SystemZCopyPhysRegs()
-    : MachineFunctionPass(ID), TII(nullptr), MRI(nullptr) {
-    initializeSystemZCopyPhysRegsPass(*PassRegistry::getPassRegistry());
-  }
+  SystemZCopyPhysRegs() : MachineFunctionPass(ID), TII(nullptr), MRI(nullptr) {}
 
   bool runOnMachineFunction(MachineFunction &MF) override;
   void getAnalysisUsage(AnalysisUsage &AU) const override;
diff --git a/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp b/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
index 789365fb9e311..81f0014dd83f2 100644
--- a/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
@@ -65,9 +65,7 @@ class SystemZElimCompare : public MachineFunctionPass {
 public:
   static char ID;
 
-  SystemZElimCompare() : MachineFunctionPass(ID) {
-    initializeSystemZElimComparePass(*PassRegistry::getPassRegistry());
-  }
+  SystemZElimCompare() : MachineFunctionPass(ID) {}
 
   bool processBlock(MachineBasicBlock &MBB);
   bool runOnMachineFunction(MachineFunction &F) override;
diff --git a/llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp b/llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp
index 06df93a60709c..a81cfeb633603 100644
--- a/llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp
@@ -28,9 +28,7 @@ namespace {
 class SystemZLDCleanup : public MachineFunctionPass {
 public:
   static char ID;
-  SystemZLDCleanup() : MachineFunctionPass(ID), TII(nullptr), MF(nullptr) {
-    initializeSystemZLDCleanupPass(*PassRegistry::getPassRegistry());
-  }
+  SystemZLDCleanup() : MachineFunctionPass(ID), TII(nullptr), MF(nullptr) {}
 
   bool runOnMachineFunction(MachineFunction &MF) override;
   void getAnalysisUsage(AnalysisUsage &AU) const override;
diff --git a/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp b/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp
index f19b932f3c731..d50d7e419faeb 100644
--- a/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp
@@ -135,9 +135,7 @@ class SystemZLongBranch : public MachineFunctionPass {
 public:
   static char ID;
 
-  SystemZLongBranch() : MachineFunctionPass(ID) {
-    initializeSystemZLongBranchPass(*PassRegistry::getPassRegistry());
-  }
+  SystemZLongBranch() : MachineFunctionPass(ID) {}
 
   bool runOnMachineFunction(MachineFunction &F) override;
 
diff --git a/llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp b/llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp
index ffeba87795625..8d4cee655235f 100644
--- a/llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp
@@ -32,9 +32,7 @@ namespace {
 class SystemZPostRewrite : public MachineFunctionPass {
 public:
   static char ID;
-  SystemZPostRewrite() : MachineFunctionPass(ID) {
-    initializeSystemZPostRewritePass(*PassRegistry::getPassRegistry());
-  }
+  SystemZPostRewrite() : MachineFunctionPass(ID) {}
 
   const SystemZInstrInfo *TII;
 
diff --git a/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp b/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
index c0adfdbf120bd..5d71c25348d95 100644
--- a/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
@@ -60,9 +60,7 @@ FunctionPass *llvm::createSystemZShortenInstPass(SystemZTargetMachine &TM) {
 }
 
 SystemZShortenInst::SystemZShortenInst()
-    : MachineFunctionPass(ID), TII(nullptr) {
-  initializeSystemZShortenInstPass(*PassRegistry::getPassRegistry());
-}
+    : MachineFunctionPass(ID), TII(nullptr) {}
 
 // Tie operands if MI has become a two-address instruction.
 static void tieOpsIfNeeded(MachineInstr &MI) {
diff --git a/llvm/lib/Target/SystemZ/SystemZTDC.cpp b/llvm/lib/Target/SystemZ/SystemZTDC.cpp
index d5baa325951c2..1e254d694e392 100644
--- a/llvm/lib/Target/SystemZ/SystemZTDC.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTDC.cpp
@@ -64,9 +64,7 @@ namespace {
 class SystemZTDCPass : public FunctionPass {
 public:
   static char ID;
-  SystemZTDCPass() : FunctionPass(ID) {
-    initializeSystemZTDCPassPass(*PassRegistry::getPassRegistry());
-  }
+  SystemZTDCPass() : FunctionPass(ID) {}
 
   bool runOnFunction(Function &F) override;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/134450


More information about the llvm-commits mailing list