Skip to content

[NFC][LLVM][RISCV] Cleanup pass initialization for RISCV #134279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions llvm/lib/Target/RISCV/GISel/RISCVO0PreLegalizerCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ void RISCVO0PreLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU) const {

RISCVO0PreLegalizerCombiner::RISCVO0PreLegalizerCombiner()
: MachineFunctionPass(ID) {
initializeRISCVO0PreLegalizerCombinerPass(*PassRegistry::getPassRegistry());

if (!RuleConfig.parseCommandLineOption())
report_fatal_error("Invalid rule identifier");
}
Expand Down Expand Up @@ -150,8 +148,6 @@ INITIALIZE_PASS_END(RISCVO0PreLegalizerCombiner, DEBUG_TYPE,
"Combine RISC-V machine instrs before legalization", false,
false)

namespace llvm {
FunctionPass *createRISCVO0PreLegalizerCombiner() {
FunctionPass *llvm::createRISCVO0PreLegalizerCombiner() {
return new RISCVO0PreLegalizerCombiner();
}
} // end namespace llvm
6 changes: 1 addition & 5 deletions llvm/lib/Target/RISCV/GISel/RISCVPostLegalizerCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ void RISCVPostLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU) const {

RISCVPostLegalizerCombiner::RISCVPostLegalizerCombiner()
: MachineFunctionPass(ID) {
initializeRISCVPostLegalizerCombinerPass(*PassRegistry::getPassRegistry());

if (!RuleConfig.parseCommandLineOption())
report_fatal_error("Invalid rule identifier");
}
Expand Down Expand Up @@ -164,8 +162,6 @@ INITIALIZE_PASS_END(RISCVPostLegalizerCombiner, DEBUG_TYPE,
"Combine RISC-V MachineInstrs after legalization", false,
false)

namespace llvm {
FunctionPass *createRISCVPostLegalizerCombiner() {
FunctionPass *llvm::createRISCVPostLegalizerCombiner() {
return new RISCVPostLegalizerCombiner();
}
} // end namespace llvm
6 changes: 1 addition & 5 deletions llvm/lib/Target/RISCV/GISel/RISCVPreLegalizerCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ void RISCVPreLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU) const {

RISCVPreLegalizerCombiner::RISCVPreLegalizerCombiner()
: MachineFunctionPass(ID) {
initializeRISCVPreLegalizerCombinerPass(*PassRegistry::getPassRegistry());

if (!RuleConfig.parseCommandLineOption())
report_fatal_error("Invalid rule identifier");
}
Expand Down Expand Up @@ -167,8 +165,6 @@ INITIALIZE_PASS_END(RISCVPreLegalizerCombiner, DEBUG_TYPE,
"Combine RISC-V machine instrs before legalization", false,
false)

namespace llvm {
FunctionPass *createRISCVPreLegalizerCombiner() {
FunctionPass *llvm::createRISCVPreLegalizerCombiner() {
return new RISCVPreLegalizerCombiner();
}
} // end namespace llvm
10 changes: 2 additions & 8 deletions llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class RISCVExpandAtomicPseudo : public MachineFunctionPass {
const RISCVInstrInfo *TII;
static char ID;

RISCVExpandAtomicPseudo() : MachineFunctionPass(ID) {
initializeRISCVExpandAtomicPseudoPass(*PassRegistry::getPassRegistry());
}
RISCVExpandAtomicPseudo() : MachineFunctionPass(ID) {}

bool runOnMachineFunction(MachineFunction &MF) override;

Expand Down Expand Up @@ -733,10 +731,6 @@ bool RISCVExpandAtomicPseudo::expandAtomicCmpXchg(
INITIALIZE_PASS(RISCVExpandAtomicPseudo, "riscv-expand-atomic-pseudo",
RISCV_EXPAND_ATOMIC_PSEUDO_NAME, false, false)

namespace llvm {

FunctionPass *createRISCVExpandAtomicPseudoPass() {
FunctionPass *llvm::createRISCVExpandAtomicPseudoPass() {
return new RISCVExpandAtomicPseudo();
}

} // end of namespace llvm
5 changes: 1 addition & 4 deletions llvm/lib/Target/RISCV/RISCVRedundantCopyElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class RISCVRedundantCopyElimination : public MachineFunctionPass {

public:
static char ID;
RISCVRedundantCopyElimination() : MachineFunctionPass(ID) {
initializeRISCVRedundantCopyEliminationPass(
*PassRegistry::getPassRegistry());
}
RISCVRedundantCopyElimination() : MachineFunctionPass(ID) {}

bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVTarget() {
initializeRISCVMoveMergePass(*PR);
initializeRISCVPushPopOptPass(*PR);
initializeRISCVLoadStoreOptPass(*PR);
initializeRISCVExpandAtomicPseudoPass(*PR);
initializeRISCVRedundantCopyEliminationPass(*PR);
}

static StringRef computeDataLayout(const Triple &TT,
Expand Down