Skip to content

Commit fef5b6f

Browse files
authored
[NFC][LLVM][PowerPC] Cleanup pass initialization for PowerPC (#134422)
- Remove calls to pass initialization from pass constructors. - #111767
1 parent 04b6f54 commit fef5b6f

16 files changed

+21
-57
lines changed

llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ class PPCBoolRetToInt : public FunctionPass {
178178
public:
179179
static char ID;
180180

181-
PPCBoolRetToInt() : FunctionPass(ID) {
182-
initializePPCBoolRetToIntPass(*PassRegistry::getPassRegistry());
183-
}
181+
PPCBoolRetToInt() : FunctionPass(ID) {}
184182

185183
bool runOnFunction(Function &F) override {
186184
if (skipFunction(F))

llvm/lib/Target/PowerPC/PPCBranchCoalescing.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ class PPCBranchCoalescing : public MachineFunctionPass {
160160
public:
161161
static char ID;
162162

163-
PPCBranchCoalescing() : MachineFunctionPass(ID) {
164-
initializePPCBranchCoalescingPass(*PassRegistry::getPassRegistry());
165-
}
163+
PPCBranchCoalescing() : MachineFunctionPass(ID) {}
166164

167165
void getAnalysisUsage(AnalysisUsage &AU) const override {
168166
AU.addRequired<MachineDominatorTreeWrapperPass>();

llvm/lib/Target/PowerPC/PPCBranchSelector.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ STATISTIC(NumPrefixedAligned,
3737
namespace {
3838
struct PPCBSel : public MachineFunctionPass {
3939
static char ID;
40-
PPCBSel() : MachineFunctionPass(ID) {
41-
initializePPCBSelPass(*PassRegistry::getPassRegistry());
42-
}
40+
PPCBSel() : MachineFunctionPass(ID) {}
4341

4442
// The sizes of the basic blocks in the function (the first
4543
// element of the pair); the second element of the pair is the amount of the

llvm/lib/Target/PowerPC/PPCCTRLoops.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ class PPCCTRLoops : public MachineFunctionPass {
5757
public:
5858
static char ID;
5959

60-
PPCCTRLoops() : MachineFunctionPass(ID) {
61-
initializePPCCTRLoopsPass(*PassRegistry::getPassRegistry());
62-
}
60+
PPCCTRLoops() : MachineFunctionPass(ID) {}
6361

6462
void getAnalysisUsage(AnalysisUsage &AU) const override {
6563
AU.addRequired<MachineLoopInfoWrapperPass>();

llvm/lib/Target/PowerPC/PPCEarlyReturn.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ namespace {
3333
// branch-to-blr sequences.
3434
struct PPCEarlyReturn : public MachineFunctionPass {
3535
static char ID;
36-
PPCEarlyReturn() : MachineFunctionPass(ID) {
37-
initializePPCEarlyReturnPass(*PassRegistry::getPassRegistry());
38-
}
36+
PPCEarlyReturn() : MachineFunctionPass(ID) {}
3937

4038
const TargetInstrInfo *TII;
4139

llvm/lib/Target/PowerPC/PPCExpandAtomicPseudoInsts.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class PPCExpandAtomicPseudo : public MachineFunctionPass {
3232
const PPCRegisterInfo *TRI;
3333
static char ID;
3434

35-
PPCExpandAtomicPseudo() : MachineFunctionPass(ID) {
36-
initializePPCExpandAtomicPseudoPass(*PassRegistry::getPassRegistry());
37-
}
35+
PPCExpandAtomicPseudo() : MachineFunctionPass(ID) {}
3836

3937
bool runOnMachineFunction(MachineFunction &MF) override;
4038

llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,7 @@ namespace {
221221
public:
222222
static char ID; // Pass ID, replacement for typeid
223223

224-
PPCLoopInstrFormPrep() : FunctionPass(ID) {
225-
initializePPCLoopInstrFormPrepPass(*PassRegistry::getPassRegistry());
226-
}
227-
228-
PPCLoopInstrFormPrep(PPCTargetMachine &TM) : FunctionPass(ID), TM(&TM) {
229-
initializePPCLoopInstrFormPrepPass(*PassRegistry::getPassRegistry());
230-
}
224+
PPCLoopInstrFormPrep(PPCTargetMachine &TM) : FunctionPass(ID), TM(&TM) {}
231225

232226
void getAnalysisUsage(AnalysisUsage &AU) const override {
233227
AU.addPreserved<DominatorTreeWrapperPass>();

llvm/lib/Target/PowerPC/PPCMIPeephole.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ struct PPCMIPeephole : public MachineFunctionPass {
112112
MachineRegisterInfo *MRI;
113113
LiveVariables *LV;
114114

115-
PPCMIPeephole() : MachineFunctionPass(ID) {
116-
initializePPCMIPeepholePass(*PassRegistry::getPassRegistry());
117-
}
115+
PPCMIPeephole() : MachineFunctionPass(ID) {}
118116

119117
private:
120118
MachineDominatorTree *MDT;

llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ static bool hasPCRelativeForm(MachineInstr &Use) {
9595
class PPCPreEmitPeephole : public MachineFunctionPass {
9696
public:
9797
static char ID;
98-
PPCPreEmitPeephole() : MachineFunctionPass(ID) {
99-
initializePPCPreEmitPeepholePass(*PassRegistry::getPassRegistry());
100-
}
98+
PPCPreEmitPeephole() : MachineFunctionPass(ID) {}
10199

102100
void getAnalysisUsage(AnalysisUsage &AU) const override {
103101
MachineFunctionPass::getAnalysisUsage(AU);

llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ static void addIncomingValuesToPHIs(MachineBasicBlock *Successor,
104104
}
105105
}
106106

107+
namespace {
107108
struct BlockSplitInfo {
108109
MachineInstr *OrigBranch;
109110
MachineInstr *SplitBefore;
@@ -127,6 +128,7 @@ struct BlockSplitInfo {
127128
return true;
128129
}
129130
};
131+
} // end anonymous namespace
130132

131133
/// Splits a MachineBasicBlock to branch before \p SplitBefore. The original
132134
/// branch is \p OrigBranch. The target of the new branch can either be the same
@@ -350,7 +352,6 @@ computeBranchTargetAndInversion(unsigned CROp, unsigned BROp, bool UsingDef1,
350352
namespace {
351353

352354
class PPCReduceCRLogicals : public MachineFunctionPass {
353-
354355
public:
355356
static char ID;
356357
struct CRLogicalOpInfo {
@@ -405,9 +406,7 @@ class PPCReduceCRLogicals : public MachineFunctionPass {
405406
}
406407

407408
public:
408-
PPCReduceCRLogicals() : MachineFunctionPass(ID) {
409-
initializePPCReduceCRLogicalsPass(*PassRegistry::getPassRegistry());
410-
}
409+
PPCReduceCRLogicals() : MachineFunctionPass(ID) {}
411410

412411
MachineInstr *lookThroughCRCopy(unsigned Reg, unsigned &Subreg,
413412
MachineInstr *&CpDef);
@@ -431,6 +430,7 @@ class PPCReduceCRLogicals : public MachineFunctionPass {
431430
MachineFunctionPass::getAnalysisUsage(AU);
432431
}
433432
};
433+
} // end anonymous namespace
434434

435435
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
436436
LLVM_DUMP_METHOD void PPCReduceCRLogicals::CRLogicalOpInfo::dump() {
@@ -726,8 +726,6 @@ void PPCReduceCRLogicals::collectCRLogicals() {
726726
}
727727
}
728728

729-
} // end anonymous namespace
730-
731729
INITIALIZE_PASS_BEGIN(PPCReduceCRLogicals, DEBUG_TYPE,
732730
"PowerPC Reduce CR logical Operation", false, false)
733731
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTreeWrapperPass)

0 commit comments

Comments
 (0)