mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 18:26:37 +00:00
[NFC][LLVM][RISCV] Cleanup pass initialization for RISCV (#134279)
- Move calls to pass initialization functions to RISCV target initialization and remove them from pass constructors.
This commit is contained in:
parent
158684a80f
commit
b393ca6026
@ -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");
|
||||
}
|
||||
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
@ -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
|
||||
|
@ -34,9 +34,7 @@ public:
|
||||
const RISCVInstrInfo *TII;
|
||||
static char ID;
|
||||
|
||||
RISCVExpandAtomicPseudo() : MachineFunctionPass(ID) {
|
||||
initializeRISCVExpandAtomicPseudoPass(*PassRegistry::getPassRegistry());
|
||||
}
|
||||
RISCVExpandAtomicPseudo() : MachineFunctionPass(ID) {}
|
||||
|
||||
bool runOnMachineFunction(MachineFunction &MF) override;
|
||||
|
||||
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user