-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[NFC][LLVM] Cleanup pass initialization for ARM/ARV/Lanai/X86/XCore #134400
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
Conversation
- Remove pass initialization from pass constructors.
1ae5f24 to
e03992c
Compare
|
@llvm/pr-subscribers-backend-arm @llvm/pr-subscribers-backend-x86 Author: Rahul Joshi (jurahul) Changes
Full diff: https://github.com/llvm/llvm-project/pull/134400.diff 8 Files Affected:
diff --git a/llvm/lib/Target/ARM/ARMFixCortexA57AES1742098Pass.cpp b/llvm/lib/Target/ARM/ARMFixCortexA57AES1742098Pass.cpp
index 5ff602364933c..7d18242d8c16a 100644
--- a/llvm/lib/Target/ARM/ARMFixCortexA57AES1742098Pass.cpp
+++ b/llvm/lib/Target/ARM/ARMFixCortexA57AES1742098Pass.cpp
@@ -70,9 +70,7 @@ namespace {
class ARMFixCortexA57AES1742098 : public MachineFunctionPass {
public:
static char ID;
- explicit ARMFixCortexA57AES1742098() : MachineFunctionPass(ID) {
- initializeARMFixCortexA57AES1742098Pass(*PassRegistry::getPassRegistry());
- }
+ explicit ARMFixCortexA57AES1742098() : MachineFunctionPass(ID) {}
bool runOnMachineFunction(MachineFunction &F) override;
diff --git a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
index f257ccea6c50a..440d852fa4bc8 100644
--- a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
@@ -34,9 +34,7 @@ class AVRExpandPseudo : public MachineFunctionPass {
public:
static char ID;
- AVRExpandPseudo() : MachineFunctionPass(ID) {
- initializeAVRExpandPseudoPass(*PassRegistry::getPassRegistry());
- }
+ AVRExpandPseudo() : MachineFunctionPass(ID) {}
bool runOnMachineFunction(MachineFunction &MF) override;
@@ -2643,8 +2641,7 @@ bool AVRExpandPseudo::expandMI(Block &MBB, BlockIt MBBI) {
INITIALIZE_PASS(AVRExpandPseudo, "avr-expand-pseudo", AVR_EXPAND_PSEUDO_NAME,
false, false)
-namespace llvm {
-
-FunctionPass *createAVRExpandPseudoPass() { return new AVRExpandPseudo(); }
-} // end of namespace llvm
+FunctionPass *llvm::createAVRExpandPseudoPass() {
+ return new AVRExpandPseudo();
+}
diff --git a/llvm/lib/Target/Lanai/Lanai.h b/llvm/lib/Target/Lanai/Lanai.h
index 72a7efc58062d..1ef4462fed648 100644
--- a/llvm/lib/Target/Lanai/Lanai.h
+++ b/llvm/lib/Target/Lanai/Lanai.h
@@ -38,6 +38,7 @@ FunctionPass *createLanaiMemAluCombinerPass();
FunctionPass *createLanaiSetflagAluCombinerPass();
void initializeLanaiDAGToDAGISelLegacyPass(PassRegistry &);
+void initializeLanaiMemAluCombinerPass(PassRegistry &);
} // namespace llvm
diff --git a/llvm/lib/Target/Lanai/LanaiMemAluCombiner.cpp b/llvm/lib/Target/Lanai/LanaiMemAluCombiner.cpp
index 2442d7ee923f1..9fd1ff60587c1 100644
--- a/llvm/lib/Target/Lanai/LanaiMemAluCombiner.cpp
+++ b/llvm/lib/Target/Lanai/LanaiMemAluCombiner.cpp
@@ -22,6 +22,7 @@
// in the same machine basic block into one machine instruction.
//===----------------------------------------------------------------------===//
+#include "Lanai.h"
#include "LanaiAluCode.h"
#include "LanaiTargetMachine.h"
#include "llvm/ADT/Statistic.h"
@@ -44,10 +45,6 @@ static llvm::cl::opt<bool> DisableMemAluCombiner(
llvm::cl::desc("Do not combine ALU and memory operators"),
llvm::cl::Hidden);
-namespace llvm {
-void initializeLanaiMemAluCombinerPass(PassRegistry &);
-} // namespace llvm
-
namespace {
typedef MachineBasicBlock::iterator MbbIterator;
typedef MachineFunction::iterator MfIterator;
@@ -55,9 +52,7 @@ typedef MachineFunction::iterator MfIterator;
class LanaiMemAluCombiner : public MachineFunctionPass {
public:
static char ID;
- explicit LanaiMemAluCombiner() : MachineFunctionPass(ID) {
- initializeLanaiMemAluCombinerPass(*PassRegistry::getPassRegistry());
- }
+ explicit LanaiMemAluCombiner() : MachineFunctionPass(ID) {}
StringRef getPassName() const override {
return "Lanai load / store optimization pass";
diff --git a/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp b/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp
index 05420b9f3c6e6..f5e83286b7052 100644
--- a/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp
+++ b/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp
@@ -26,16 +26,13 @@
using namespace llvm;
-namespace llvm {
-void initializeLanaiMemAluCombinerPass(PassRegistry &);
-} // namespace llvm
-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLanaiTarget() {
// Register the target.
RegisterTargetMachine<LanaiTargetMachine> registered_target(
getTheLanaiTarget());
PassRegistry &PR = *PassRegistry::getPassRegistry();
initializeLanaiDAGToDAGISelLegacyPass(PR);
+ initializeLanaiMemAluCombinerPass(PR);
}
static std::string computeDataLayout() {
diff --git a/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp b/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
index 0a187ee42e3f8..7f3393910da2c 100644
--- a/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
+++ b/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
@@ -631,10 +631,7 @@ class X86LowerAMXIntrinsicsLegacyPass : public FunctionPass {
public:
static char ID;
- X86LowerAMXIntrinsicsLegacyPass() : FunctionPass(ID) {
- initializeX86LowerAMXIntrinsicsLegacyPassPass(
- *PassRegistry::getPassRegistry());
- }
+ X86LowerAMXIntrinsicsLegacyPass() : FunctionPass(ID) {}
bool runOnFunction(Function &F) override {
if (!X86ScalarizeAMX)
diff --git a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
index 3870e80f9559b..9e373021a826a 100644
--- a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
+++ b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
@@ -41,9 +41,7 @@ namespace {
struct XCoreLowerThreadLocal : public ModulePass {
static char ID;
- XCoreLowerThreadLocal() : ModulePass(ID) {
- initializeXCoreLowerThreadLocalPass(*PassRegistry::getPassRegistry());
- }
+ XCoreLowerThreadLocal() : ModulePass(ID) {}
bool lowerGlobal(GlobalVariable *GV);
diff --git a/llvm/lib/Target/XCore/XCoreTargetMachine.cpp b/llvm/lib/Target/XCore/XCoreTargetMachine.cpp
index a04f5b9e662e3..fc93ab5c500e0 100644
--- a/llvm/lib/Target/XCore/XCoreTargetMachine.cpp
+++ b/llvm/lib/Target/XCore/XCoreTargetMachine.cpp
@@ -106,6 +106,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXCoreTarget() {
RegisterTargetMachine<XCoreTargetMachine> X(getTheXCoreTarget());
PassRegistry &PR = *PassRegistry::getPassRegistry();
initializeXCoreDAGToDAGISelLegacyPass(PR);
+ initializeXCoreLowerThreadLocalPass(PR);
}
TargetTransformInfo
|
efriedma-quic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
RKSimon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Uh oh!
There was an error while loading. Please reload this page.