Skip to content

Commit f8b0a22

Browse files
committed
moving R600CodeGenPassBuilder into R600TargetMachine.
1 parent a109105 commit f8b0a22

File tree

6 files changed

+24
-77
lines changed

6 files changed

+24
-77
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "GCNSchedStrategy.h"
3333
#include "GCNVOPDUtils.h"
3434
#include "R600.h"
35-
#include "R600CodeGenPassBuilder.h"
3635
#include "R600MachineFunctionInfo.h"
36+
#include "R600TargetMachine.h"
3737
#include "SIFixSGPRCopies.h"
3838
#include "SIMachineFunctionInfo.h"
3939
#include "SIMachineScheduler.h"

llvm/lib/Target/AMDGPU/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ add_llvm_target(AMDGPUCodeGen
121121
GCNVOPDUtils.cpp
122122
R600AsmPrinter.cpp
123123
R600ClauseMergePass.cpp
124-
R600CodeGenPassBuilder.cpp
125124
R600ControlFlowFinalizer.cpp
126125
R600EmitClauseMarkers.cpp
127126
R600ExpandSpecialInstrs.cpp
@@ -137,6 +136,7 @@ add_llvm_target(AMDGPUCodeGen
137136
R600Packetizer.cpp
138137
R600RegisterInfo.cpp
139138
R600Subtarget.cpp
139+
R600TargetMachine.cpp
140140
R600TargetTransformInfo.cpp
141141
SIAnnotateControlFlow.cpp
142142
SIFixSGPRCopies.cpp

llvm/lib/Target/AMDGPU/R600CodeGenPassBuilder.h

Lines changed: 0 additions & 68 deletions
This file was deleted.

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#include "R600ISelLowering.h"
1515
#include "AMDGPU.h"
1616
#include "MCTargetDesc/R600MCTargetDesc.h"
17-
#include "R600CodeGenPassBuilder.h"
1817
#include "R600Defines.h"
1918
#include "R600MachineFunctionInfo.h"
2019
#include "R600Subtarget.h"
20+
#include "R600TargetMachine.h"
2121
#include "llvm/CodeGen/MachineFunction.h"
2222
#include "llvm/IR/IntrinsicsAMDGPU.h"
2323
#include "llvm/IR/IntrinsicsR600.h"

llvm/lib/Target/AMDGPU/R600CodeGenPassBuilder.cpp renamed to llvm/lib/Target/AMDGPU/R600TargetMachine.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- R600CodeGenPassBuilder.cpp ------ Build R600 CodeGen pipeline -----===//
1+
//===-- R600TargetMachine.cpp - TargetMachine for hw codegen targets-------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,11 +10,11 @@
1010
/// This file contains both AMDGPU-R600 target machine and the CodeGen pass
1111
/// builder. The target machine contains all of the hardware specific
1212
/// information needed to emit code for R600 GPUs and the CodeGen pass builder
13-
/// handles the same for new pass manager infrastructure.
13+
/// handles the pass pipeline for new pass manager.
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17-
#include "R600CodeGenPassBuilder.h"
17+
#include "R600TargetMachine.h"
1818
#include "R600.h"
1919
#include "R600MachineScheduler.h"
2020
#include "R600TargetTransformInfo.h"
@@ -46,7 +46,7 @@ static MachineSchedRegistry R600SchedRegistry("r600",
4646
createR600MachineScheduler);
4747

4848
//===----------------------------------------------------------------------===//
49-
// R600 Target Machine (R600 -> Cayman) - Legacy Pass Manager interface.
49+
// R600 Target Machine (R600 -> Cayman)
5050
//===----------------------------------------------------------------------===//
5151

5252
R600TargetMachine::R600TargetMachine(const Target &T, const Triple &TT,
@@ -109,7 +109,7 @@ class R600PassConfig final : public AMDGPUPassConfig {
109109
} // namespace
110110

111111
//===----------------------------------------------------------------------===//
112-
// R600 Legacy Pass Setup
112+
// R600 Pass Setup
113113
//===----------------------------------------------------------------------===//
114114

115115
bool R600PassConfig::addPreISel() {
@@ -155,7 +155,7 @@ Error R600TargetMachine::buildCodeGenPipeline(
155155
}
156156

157157
//===----------------------------------------------------------------------===//
158-
// R600 Target Machine (R600 -> Cayman)
158+
// R600 CodeGen Pass Builder interface.
159159
//===----------------------------------------------------------------------===//
160160

161161
R600CodeGenPassBuilder::R600CodeGenPassBuilder(

llvm/lib/Target/AMDGPU/R600TargetMachine.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ class R600TargetMachine final : public AMDGPUTargetMachine {
5555
const TargetSubtargetInfo *STI) const override;
5656
};
5757

58+
//===----------------------------------------------------------------------===//
59+
// R600 CodeGen Pass Builder interface.
60+
//===----------------------------------------------------------------------===//
61+
62+
class R600CodeGenPassBuilder
63+
: public CodeGenPassBuilder<R600CodeGenPassBuilder, R600TargetMachine> {
64+
public:
65+
R600CodeGenPassBuilder(R600TargetMachine &TM, const CGPassBuilderOption &Opts,
66+
PassInstrumentationCallbacks *PIC);
67+
68+
void addPreISel(AddIRPass &addPass) const;
69+
void addAsmPrinter(AddMachinePass &, CreateMCStreamer) const;
70+
Error addInstSelector(AddMachinePass &) const;
71+
};
72+
5873
} // end namespace llvm
5974

6075
#endif // LLVM_LIB_TARGET_AMDGPU_R600TARGETMACHINE_H

0 commit comments

Comments
 (0)