diff --git a/llvm/lib/Target/X86/X86.h b/llvm/lib/Target/X86/X86.h --- a/llvm/lib/Target/X86/X86.h +++ b/llvm/lib/Target/X86/X86.h @@ -132,6 +132,7 @@ void initializeEvexToVexInstPassPass(PassRegistry &); void initializeFixupBWInstPassPass(PassRegistry &); void initializeFixupLEAPassPass(PassRegistry &); +void initializeFPSPass(PassRegistry &); void initializeWinEHStatePassPass(PassRegistry &); void initializeX86AvoidSFBPassPass(PassRegistry &); void initializeX86CallFrameOptimizationPass(PassRegistry &); diff --git a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp --- a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp +++ b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp @@ -68,9 +68,7 @@ class X86AvoidSFBPass : public MachineFunctionPass { public: static char ID; - X86AvoidSFBPass() : MachineFunctionPass(ID) { - initializeX86AvoidSFBPassPass(*PassRegistry::getPassRegistry()); - } + X86AvoidSFBPass() : MachineFunctionPass(ID) { } StringRef getPassName() const override { return "X86 Avoid Store Forwarding Blocks"; diff --git a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp --- a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp +++ b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp @@ -59,10 +59,7 @@ class X86CallFrameOptimization : public MachineFunctionPass { public: - X86CallFrameOptimization() : MachineFunctionPass(ID) { - initializeX86CallFrameOptimizationPass( - *PassRegistry::getPassRegistry()); - } + X86CallFrameOptimization() : MachineFunctionPass(ID) { } bool runOnMachineFunction(MachineFunction &MF) override; diff --git a/llvm/lib/Target/X86/X86CmovConversion.cpp b/llvm/lib/Target/X86/X86CmovConversion.cpp --- a/llvm/lib/Target/X86/X86CmovConversion.cpp +++ b/llvm/lib/Target/X86/X86CmovConversion.cpp @@ -101,9 +101,7 @@ /// Converts X86 cmov instructions into branches when profitable. class X86CmovConverterPass : public MachineFunctionPass { public: - X86CmovConverterPass() : MachineFunctionPass(ID) { - initializeX86CmovConverterPassPass(*PassRegistry::getPassRegistry()); - } + X86CmovConverterPass() : MachineFunctionPass(ID) { } StringRef getPassName() const override { return "X86 cmov Conversion"; } bool runOnMachineFunction(MachineFunction &MF) override; diff --git a/llvm/lib/Target/X86/X86CondBrFolding.cpp b/llvm/lib/Target/X86/X86CondBrFolding.cpp --- a/llvm/lib/Target/X86/X86CondBrFolding.cpp +++ b/llvm/lib/Target/X86/X86CondBrFolding.cpp @@ -61,9 +61,7 @@ namespace { class X86CondBrFoldingPass : public MachineFunctionPass { public: - X86CondBrFoldingPass() : MachineFunctionPass(ID) { - initializeX86CondBrFoldingPassPass(*PassRegistry::getPassRegistry()); - } + X86CondBrFoldingPass() : MachineFunctionPass(ID) { } StringRef getPassName() const override { return "X86 CondBr Folding"; } bool runOnMachineFunction(MachineFunction &MF) override; diff --git a/llvm/lib/Target/X86/X86DomainReassignment.cpp b/llvm/lib/Target/X86/X86DomainReassignment.cpp --- a/llvm/lib/Target/X86/X86DomainReassignment.cpp +++ b/llvm/lib/Target/X86/X86DomainReassignment.cpp @@ -386,9 +386,7 @@ public: static char ID; - X86DomainReassignment() : MachineFunctionPass(ID) { - initializeX86DomainReassignmentPass(*PassRegistry::getPassRegistry()); - } + X86DomainReassignment() : MachineFunctionPass(ID) { } bool runOnMachineFunction(MachineFunction &MF) override; diff --git a/llvm/lib/Target/X86/X86EvexToVex.cpp b/llvm/lib/Target/X86/X86EvexToVex.cpp --- a/llvm/lib/Target/X86/X86EvexToVex.cpp +++ b/llvm/lib/Target/X86/X86EvexToVex.cpp @@ -68,9 +68,7 @@ public: static char ID; - EvexToVexInstPass() : MachineFunctionPass(ID) { - initializeEvexToVexInstPassPass(*PassRegistry::getPassRegistry()); - } + EvexToVexInstPass() : MachineFunctionPass(ID) { } StringRef getPassName() const override { return EVEX2VEX_DESC; } diff --git a/llvm/lib/Target/X86/X86FixupBWInsts.cpp b/llvm/lib/Target/X86/X86FixupBWInsts.cpp --- a/llvm/lib/Target/X86/X86FixupBWInsts.cpp +++ b/llvm/lib/Target/X86/X86FixupBWInsts.cpp @@ -102,9 +102,7 @@ StringRef getPassName() const override { return FIXUPBW_DESC; } - FixupBWInstPass() : MachineFunctionPass(ID) { - initializeFixupBWInstPassPass(*PassRegistry::getPassRegistry()); - } + FixupBWInstPass() : MachineFunctionPass(ID) { } void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired(); // Machine loop info is used to diff --git a/llvm/lib/Target/X86/X86FixupLEAs.cpp b/llvm/lib/Target/X86/X86FixupLEAs.cpp --- a/llvm/lib/Target/X86/X86FixupLEAs.cpp +++ b/llvm/lib/Target/X86/X86FixupLEAs.cpp @@ -98,9 +98,7 @@ StringRef getPassName() const override { return FIXUPLEA_DESC; } - FixupLEAPass() : MachineFunctionPass(ID) { - initializeFixupLEAPassPass(*PassRegistry::getPassRegistry()); - } + FixupLEAPass() : MachineFunctionPass(ID) { } /// Loop over all of the basic blocks, /// replacing instructions by equivalent LEA instructions diff --git a/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp b/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp --- a/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp +++ b/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp @@ -70,12 +70,6 @@ STATISTIC(NumTestsInserted, "Number of test instructions inserted"); STATISTIC(NumAddsInserted, "Number of adds instructions inserted"); -namespace llvm { - -void initializeX86FlagsCopyLoweringPassPass(PassRegistry &); - -} // end namespace llvm - namespace { // Convenient array type for storing registers associated with each condition. @@ -83,9 +77,7 @@ class X86FlagsCopyLoweringPass : public MachineFunctionPass { public: - X86FlagsCopyLoweringPass() : MachineFunctionPass(ID) { - initializeX86FlagsCopyLoweringPassPass(*PassRegistry::getPassRegistry()); - } + X86FlagsCopyLoweringPass() : MachineFunctionPass(ID) { } StringRef getPassName() const override { return "X86 EFLAGS copy lowering"; } bool runOnMachineFunction(MachineFunction &MF) override; diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp --- a/llvm/lib/Target/X86/X86FloatingPoint.cpp +++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp @@ -59,7 +59,6 @@ struct FPS : public MachineFunctionPass { static char ID; FPS() : MachineFunctionPass(ID) { - initializeEdgeBundlesPass(*PassRegistry::getPassRegistry()); // This is really only to keep valgrind quiet. // The logic in isLive() is too much for it. memset(Stack, 0, sizeof(Stack)); @@ -298,9 +297,16 @@ void setKillFlags(MachineBasicBlock &MBB) const; }; - char FPS::ID = 0; } +char FPS::ID = 0; + +INITIALIZE_PASS_BEGIN(FPS, DEBUG_TYPE, "X86 FP Stackifier", + false, false) +INITIALIZE_PASS_DEPENDENCY(EdgeBundles) +INITIALIZE_PASS_END(FPS, DEBUG_TYPE, "X86 FP Stackifier", + false, false) + FunctionPass *llvm::createX86FloatingPointStackifierPass() { return new FPS(); } /// getFPReg - Return the X86::FPx register number for the specified operand. diff --git a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp --- a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp +++ b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp @@ -122,10 +122,7 @@ class X86SpeculativeLoadHardeningPass : public MachineFunctionPass { public: - X86SpeculativeLoadHardeningPass() : MachineFunctionPass(ID) { - initializeX86SpeculativeLoadHardeningPassPass( - *PassRegistry::getPassRegistry()); - } + X86SpeculativeLoadHardeningPass() : MachineFunctionPass(ID) { } StringRef getPassName() const override { return "X86 speculative load hardening"; diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -71,6 +71,7 @@ initializeFixupBWInstPassPass(PR); initializeEvexToVexInstPassPass(PR); initializeFixupLEAPassPass(PR); + initializeFPSPass(PR); initializeX86CallFrameOptimizationPass(PR); initializeX86CmovConverterPassPass(PR); initializeX86ExpandPseudoPass(PR); diff --git a/llvm/lib/Target/X86/X86WinEHState.cpp b/llvm/lib/Target/X86/X86WinEHState.cpp --- a/llvm/lib/Target/X86/X86WinEHState.cpp +++ b/llvm/lib/Target/X86/X86WinEHState.cpp @@ -40,9 +40,7 @@ public: static char ID; // Pass identification, replacement for typeid. - WinEHStatePass() : FunctionPass(ID) { - initializeWinEHStatePassPass(*PassRegistry::getPassRegistry()); - } + WinEHStatePass() : FunctionPass(ID) { } bool runOnFunction(Function &Fn) override;