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)

llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ using namespace llvm;
3838
namespace {
3939
struct PPCTLSDynamicCall : public MachineFunctionPass {
4040
static char ID;
41-
PPCTLSDynamicCall() : MachineFunctionPass(ID) {
42-
initializePPCTLSDynamicCallPass(*PassRegistry::getPassRegistry());
43-
}
41+
PPCTLSDynamicCall() : MachineFunctionPass(ID) {}
4442

4543
const PPCInstrInfo *TII;
4644

llvm/lib/Target/PowerPC/PPCTOCRegDeps.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ namespace {
8080
// branch-to-blr sequences.
8181
struct PPCTOCRegDeps : public MachineFunctionPass {
8282
static char ID;
83-
PPCTOCRegDeps() : MachineFunctionPass(ID) {
84-
initializePPCTOCRegDepsPass(*PassRegistry::getPassRegistry());
85-
}
83+
PPCTOCRegDeps() : MachineFunctionPass(ID) {}
8684

87-
protected:
85+
protected:
8886
bool hasTOCLoReloc(const MachineInstr &MI) {
8987
if (MI.getOpcode() == PPC::LDtocL || MI.getOpcode() == PPC::ADDItocL8 ||
9088
MI.getOpcode() == PPC::LWZtocL)

llvm/lib/Target/PowerPC/PPCTargetMachine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ void PPCPassConfig::addMachineSSAOptimization() {
561561

562562
void PPCPassConfig::addPreRegAlloc() {
563563
if (getOptLevel() != CodeGenOptLevel::None) {
564-
initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
565564
insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
566565
&PPCVSXFMAMutateID);
567566
}

llvm/lib/Target/PowerPC/PPCVSXCopy.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ namespace {
3434
// copies into subregister copies with other restrictions.
3535
struct PPCVSXCopy : public MachineFunctionPass {
3636
static char ID;
37-
PPCVSXCopy() : MachineFunctionPass(ID) {
38-
initializePPCVSXCopyPass(*PassRegistry::getPassRegistry());
39-
}
37+
PPCVSXCopy() : MachineFunctionPass(ID) {}
4038

4139
const TargetInstrInfo *TII;
4240

@@ -151,7 +149,7 @@ namespace {
151149
MachineFunctionPass::getAnalysisUsage(AU);
152150
}
153151
};
154-
}
152+
} // end anonymous namespace
155153

156154
INITIALIZE_PASS(PPCVSXCopy, DEBUG_TYPE,
157155
"PowerPC VSX Copy Legalization", false, false)

llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ namespace {
5555
// copies into subregister copies with other restrictions.
5656
struct PPCVSXFMAMutate : public MachineFunctionPass {
5757
static char ID;
58-
PPCVSXFMAMutate() : MachineFunctionPass(ID) {
59-
initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
60-
}
58+
PPCVSXFMAMutate() : MachineFunctionPass(ID) {}
6159

6260
LiveIntervals *LIS;
6361
const PPCInstrInfo *TII;

llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ struct PPCVSXSwapRemoval : public MachineFunctionPass {
110110
// Swap entries are represented by their VSEId fields.
111111
EquivalenceClasses<int> *EC;
112112

113-
PPCVSXSwapRemoval() : MachineFunctionPass(ID) {
114-
initializePPCVSXSwapRemovalPass(*PassRegistry::getPassRegistry());
115-
}
113+
PPCVSXSwapRemoval() : MachineFunctionPass(ID) {}
116114

117115
private:
118116
// Initialize data structures.
@@ -211,6 +209,7 @@ struct PPCVSXSwapRemoval : public MachineFunctionPass {
211209
return Changed;
212210
}
213211
};
212+
} // end anonymous namespace
214213

215214
// Initialize data structures for this pass. In particular, clear the
216215
// swap vector and allocate the equivalence class mapping before
@@ -1061,8 +1060,6 @@ LLVM_DUMP_METHOD void PPCVSXSwapRemoval::dumpSwapVector() {
10611060
}
10621061
#endif
10631062

1064-
} // end default namespace
1065-
10661063
INITIALIZE_PASS_BEGIN(PPCVSXSwapRemoval, DEBUG_TYPE,
10671064
"PowerPC VSX Swap Removal", false, false)
10681065
INITIALIZE_PASS_END(PPCVSXSwapRemoval, DEBUG_TYPE,

0 commit comments

Comments
 (0)