Skip to content

Commit a3754ad

Browse files
authored
[NFC][LLVM][AMDGPU] Cleanup pass initialization for AMDGPU (llvm#134410)
- Remove calls to pass initialization from pass constructors. - llvm#111767
1 parent 1356e20 commit a3754ad

24 files changed

+30
-99
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ ImmutablePass *llvm::createAMDGPUExternalAAWrapperPass() {
3838
return new AMDGPUExternalAAWrapper();
3939
}
4040

41-
AMDGPUAAWrapperPass::AMDGPUAAWrapperPass() : ImmutablePass(ID) {
42-
initializeAMDGPUAAWrapperPassPass(*PassRegistry::getPassRegistry());
43-
}
41+
AMDGPUAAWrapperPass::AMDGPUAAWrapperPass() : ImmutablePass(ID) {}
4442

4543
void AMDGPUAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
4644
AU.setPreservesAll();

llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717
#include "llvm/CodeGen/TargetPassConfig.h"
1818
#include "llvm/IR/IntrinsicsAMDGPU.h"
1919
#include "llvm/IR/IntrinsicsR600.h"
20+
#include "llvm/InitializePasses.h"
2021
#include "llvm/Target/TargetMachine.h"
2122
#include "llvm/Transforms/IPO/Attributor.h"
2223

2324
#define DEBUG_TYPE "amdgpu-attributor"
2425

25-
namespace llvm {
26-
void initializeCycleInfoWrapperPassPass(PassRegistry &);
27-
} // namespace llvm
28-
2926
using namespace llvm;
3027

3128
static cl::opt<unsigned> KernargPreloadCount(

llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,7 @@ class AMDGPUCodeGenPrepareImpl
336336
class AMDGPUCodeGenPrepare : public FunctionPass {
337337
public:
338338
static char ID;
339-
AMDGPUCodeGenPrepare() : FunctionPass(ID) {
340-
initializeAMDGPUCodeGenPreparePass(*PassRegistry::getPassRegistry());
341-
}
339+
AMDGPUCodeGenPrepare() : FunctionPass(ID) {}
342340
void getAnalysisUsage(AnalysisUsage &AU) const override {
343341
AU.addRequired<AssumptionCacheTracker>();
344342
AU.addRequired<UniformityInfoWrapperPass>();

llvm/lib/Target/AMDGPU/AMDGPUExportClustering.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ void ExportClustering::apply(ScheduleDAGInstrs *DAG) {
139139

140140
} // end namespace
141141

142-
namespace llvm {
143-
144-
std::unique_ptr<ScheduleDAGMutation> createAMDGPUExportClusteringDAGMutation() {
142+
std::unique_ptr<ScheduleDAGMutation>
143+
llvm::createAMDGPUExportClusteringDAGMutation() {
145144
return std::make_unique<ExportClustering>();
146145
}
147-
148-
} // end namespace llvm

llvm/lib/Target/AMDGPU/AMDGPUGlobalISelDivergenceLowering.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ class AMDGPUGlobalISelDivergenceLowering : public MachineFunctionPass {
3434
static char ID;
3535

3636
public:
37-
AMDGPUGlobalISelDivergenceLowering() : MachineFunctionPass(ID) {
38-
initializeAMDGPUGlobalISelDivergenceLoweringPass(
39-
*PassRegistry::getPassRegistry());
40-
}
37+
AMDGPUGlobalISelDivergenceLowering() : MachineFunctionPass(ID) {}
4138

4239
bool runOnMachineFunction(MachineFunction &MF) override;
4340

llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,16 +2696,12 @@ bool IGroupLPDAGMutation::initIGLPOpt(SUnit &SU) {
26962696

26972697
} // namespace
26982698

2699-
namespace llvm {
2700-
27012699
/// \p Phase specifes whether or not this is a reentry into the
27022700
/// IGroupLPDAGMutation. Since there may be multiple scheduling passes on the
27032701
/// same scheduling region (e.g. pre and post-RA scheduling / multiple
27042702
/// scheduling "phases"), we can reenter this mutation framework more than once
27052703
/// for a given region.
27062704
std::unique_ptr<ScheduleDAGMutation>
2707-
createIGroupLPDAGMutation(AMDGPU::SchedulingPhase Phase) {
2705+
llvm::createIGroupLPDAGMutation(AMDGPU::SchedulingPhase Phase) {
27082706
return std::make_unique<IGroupLPDAGMutation>(Phase);
27092707
}
2710-
2711-
} // end namespace llvm

llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,10 +2312,7 @@ class AMDGPULowerBufferFatPointers : public ModulePass {
23122312
public:
23132313
static char ID;
23142314

2315-
AMDGPULowerBufferFatPointers() : ModulePass(ID) {
2316-
initializeAMDGPULowerBufferFatPointersPass(
2317-
*PassRegistry::getPassRegistry());
2318-
}
2315+
AMDGPULowerBufferFatPointers() : ModulePass(ID) {}
23192316

23202317
bool run(Module &M, const TargetMachine &TM);
23212318
bool runOnModule(Module &M) override;

llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,10 +1502,8 @@ class AMDGPULowerModuleLDSLegacy : public ModulePass {
15021502
const AMDGPUTargetMachine *TM;
15031503
static char ID;
15041504

1505-
AMDGPULowerModuleLDSLegacy(const AMDGPUTargetMachine *TM_ = nullptr)
1506-
: ModulePass(ID), TM(TM_) {
1507-
initializeAMDGPULowerModuleLDSLegacyPass(*PassRegistry::getPassRegistry());
1508-
}
1505+
AMDGPULowerModuleLDSLegacy(const AMDGPUTargetMachine *TM = nullptr)
1506+
: ModulePass(ID), TM(TM) {}
15091507

15101508
void getAnalysisUsage(AnalysisUsage &AU) const override {
15111509
if (!TM)

llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "AMDGPUMachineModuleInfo.h"
1616
#include "llvm/IR/Module.h"
1717

18-
namespace llvm {
18+
using namespace llvm;
1919

2020
AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(const MachineModuleInfo &MMI)
2121
: MachineModuleInfoELF(MMI) {
@@ -34,5 +34,3 @@ AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(const MachineModuleInfo &MMI)
3434
SingleThreadOneAddressSpaceSSID =
3535
CTX.getOrInsertSyncScopeID("singlethread-one-as");
3636
}
37-
38-
} // end namespace llvm

llvm/lib/Target/AMDGPU/AMDGPUMarkLastScratchLoad.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ class AMDGPUMarkLastScratchLoadLegacy : public MachineFunctionPass {
4242
public:
4343
static char ID;
4444

45-
AMDGPUMarkLastScratchLoadLegacy() : MachineFunctionPass(ID) {
46-
initializeAMDGPUMarkLastScratchLoadLegacyPass(
47-
*PassRegistry::getPassRegistry());
48-
}
45+
AMDGPUMarkLastScratchLoadLegacy() : MachineFunctionPass(ID) {}
4946

5047
bool runOnMachineFunction(MachineFunction &MF) override;
5148

0 commit comments

Comments
 (0)