Skip to content

Commit 651c7e1

Browse files
committed
GlobalISel: Remove redundant pass initialization
Summary: All the GlobalISel passes are initialized when the target calls initializeGlobalISel(), so we don't need to call the initializers from the pass constructors. Reviewers: qcolombet, t.p.northover, paquette, dsanders, aemerson, aditya_nandakumar Reviewed By: aemerson Subscribers: rovka, kristof.beyls, hiraditya, volkan, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63235 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363642 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1a8c687 commit 651c7e1

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
lines changed

lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ static void reportTranslationError(MachineFunction &MF,
106106
ORE.emit(R);
107107
}
108108

109-
IRTranslator::IRTranslator() : MachineFunctionPass(ID) {
110-
initializeIRTranslatorPass(*PassRegistry::getPassRegistry());
111-
}
109+
IRTranslator::IRTranslator() : MachineFunctionPass(ID) { }
112110

113111
#ifndef NDEBUG
114112
namespace {

lib/CodeGen/GlobalISel/InstructionSelect.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ INITIALIZE_PASS_END(InstructionSelect, DEBUG_TYPE,
4949
"Select target instructions out of generic instructions",
5050
false, false)
5151

52-
InstructionSelect::InstructionSelect() : MachineFunctionPass(ID) {
53-
initializeInstructionSelectPass(*PassRegistry::getPassRegistry());
54-
}
52+
InstructionSelect::InstructionSelect() : MachineFunctionPass(ID) { }
5553

5654
void InstructionSelect::getAnalysisUsage(AnalysisUsage &AU) const {
5755
AU.addRequired<TargetPassConfig>();

lib/CodeGen/GlobalISel/Legalizer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ INITIALIZE_PASS_END(Legalizer, DEBUG_TYPE,
5050
"Legalize the Machine IR a function's Machine IR", false,
5151
false)
5252

53-
Legalizer::Legalizer() : MachineFunctionPass(ID) {
54-
initializeLegalizerPass(*PassRegistry::getPassRegistry());
55-
}
53+
Legalizer::Legalizer() : MachineFunctionPass(ID) { }
5654

5755
void Legalizer::getAnalysisUsage(AnalysisUsage &AU) const {
5856
AU.addRequired<TargetPassConfig>();

lib/CodeGen/GlobalISel/Localizer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ INITIALIZE_PASS_END(Localizer, DEBUG_TYPE,
2929
"Move/duplicate certain instructions close to their use",
3030
false, false)
3131

32-
Localizer::Localizer() : MachineFunctionPass(ID) {
33-
initializeLocalizerPass(*PassRegistry::getPassRegistry());
34-
}
32+
Localizer::Localizer() : MachineFunctionPass(ID) { }
3533

3634
void Localizer::init(MachineFunction &MF) {
3735
MRI = &MF.getRegInfo();

lib/CodeGen/GlobalISel/RegBankSelect.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,
7171

7272
RegBankSelect::RegBankSelect(Mode RunningMode)
7373
: MachineFunctionPass(ID), OptMode(RunningMode) {
74-
initializeRegBankSelectPass(*PassRegistry::getPassRegistry());
7574
if (RegBankSelectMode.getNumOccurrences() != 0) {
7675
OptMode = RegBankSelectMode;
7776
if (RegBankSelectMode != RunningMode)

0 commit comments

Comments
 (0)