LLVM: lib/Target/AMDGPU/R600TargetMachine.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
24#include
25
26using namespace llvm;
27
30 cl::desc("Use StructurizeCFG IR pass"),
32
34 cl::desc("Use if conversion pass"),
36
38 "amdgpu-function-calls", cl::desc("Enable AMDGPU function call support"),
41
45
47 "Run R600's custom scheduler",
49
50
51
52
53
64
65
66
67
68
72 std::optionalReloc::Model RM,
73 std::optionalCodeModel::Model CM,
77
78
82}
83
88
90 SubtargetKey.append(FS);
91
92 auto &I = SubtargetMap[SubtargetKey];
93 if () {
94
95
96
98 I = std::make_unique(TargetTriple, GPU, FS, *this);
99 }
100
101 return I.get();
102}
103
108
113
114namespace {
116public:
119
120 bool addPreISel() override;
121 bool addInstSelector() override;
122 void addPreRegAlloc() override;
123 void addPreSched2() override;
124 void addPreEmitPass() override;
125};
126}
127
128
129
130
131
132bool R600PassConfig::addPreISel() {
134
137 return false;
138}
139
140bool R600PassConfig::addInstSelector() {
141 addPass(createR600ISelDag(getAMDGPUTargetMachine(), getOptLevel()));
142 return false;
143}
144
146
147void R600PassConfig::addPreSched2() {
152}
153
154void R600PassConfig::addPreEmitPass() {
159}
160
162 return new R600PassConfig(*this, PM);
163}
164
172
179
180
181
182
183
188 Opt.RequiresCodeGenSCCOrder = true;
189}
190
194
199
Interfaces for producing common pass manager configurations.
PassInstrumentationCallbacks PIC
R600 Machine Scheduler interface.
static cl::opt< bool > EnableR600IfConvert("r600-if-convert", cl::desc("Use if conversion pass"), cl::ReallyHidden, cl::init(true))
static cl::opt< bool > EnableR600StructurizeCFG("r600-ir-structurize", cl::desc("Use StructurizeCFG IR pass"), cl::init(true))
static ScheduleDAGInstrs * createR600MachineScheduler(MachineSchedContext *C)
Definition R600TargetMachine.cpp:42
static MachineSchedRegistry R600SchedRegistry("r600", "Run R600's custom scheduler", createR600MachineScheduler)
static cl::opt< bool, true > EnableAMDGPUFunctionCallsOpt("amdgpu-function-calls", cl::desc("Enable AMDGPU function call support"), cl::location(AMDGPUTargetMachine::EnableFunctionCalls), cl::init(true), cl::Hidden)
The AMDGPU TargetMachine interface definition for hw codegen targets.
This file a TargetTransformInfoImplBase conforming object specific to the R600 target machine.
void addPreISel(AddIRPass &addPass) const
Definition R600TargetMachine.cpp:191
R600CodeGenPassBuilder(R600TargetMachine &TM, const CGPassBuilderOption &Opts, PassInstrumentationCallbacks *PIC)
Definition R600TargetMachine.cpp:184
void addAsmPrinter(AddMachinePass &, CreateMCStreamer) const
Definition R600TargetMachine.cpp:195
Error addInstSelector(AddMachinePass &) const
Definition R600TargetMachine.cpp:200
bool addPreISel() override
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where t...
const TargetSubtargetInfo * getSubtargetImpl() const
StringRef getFeatureString(const Function &F) const
static bool EnableFunctionCalls
AMDGPUTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL)
StringRef getGPUName(const Function &F) const
Error buildPipeline(ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType) const
std::function< Expected< std::unique_ptr< MCStreamer > >(MCContext &)> CreateMCStreamer
PassInstrumentationCallbacks * PIC
CodeGenPassBuilder(R600TargetMachine &TM, const CGPassBuilderOption &Opts, PassInstrumentationCallbacks *PIC)
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
MachineSchedRegistry provides a selection of available machine instruction schedulers.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
Error buildCodeGenPipeline(ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, const CGPassBuilderOption &Opt, PassInstrumentationCallbacks *PIC) override
Definition R600TargetMachine.cpp:165
R600TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
Definition R600TargetMachine.cpp:69
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Definition R600TargetMachine.cpp:161
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
Definition R600TargetMachine.cpp:173
ScheduleDAGInstrs * createMachineScheduler(MachineSchedContext *C) const override
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this ...
Definition R600TargetMachine.cpp:110
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
Definition R600TargetMachine.cpp:105
A ScheduleDAG for scheduling lists of MachineInstr.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void append(StringRef RHS)
Append from a StringRef.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
void setRequiresStructuredCFG(bool Value)
std::unique_ptr< const MCSubtargetInfo > STI
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
Target-Independent Code Generator Pass Configuration Options.
TargetSubtargetInfo - Generic base class for all target subtargets.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
An abstract base class for streams implementations that also support a pwrite operation.
@ C
The default llvm calling convention, compatible with C.
initializer< Ty > init(const Ty &Val)
LocationClass< Ty > location(Ty &L)
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createR600ExpandSpecialInstrsPass()
LLVM_ABI Pass * createStructurizeCFGPass(bool SkipUniformRegions=false)
When SkipUniformRegions is true the structizer will not structurize regions that only contain uniform...
FunctionPass * createR600Packetizer()
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
FunctionPass * createR600EmitClauseMarkers()
CodeGenOptLevel
Code generation optimization level.
FunctionPass * createR600ISelDag(TargetMachine &TM, CodeGenOptLevel OptLevel)
This pass converts a legalized DAG into a R600-specific.
FunctionPass * createR600ControlFlowFinalizer()
FunctionPass * createR600ClauseMergePass()
FunctionPass * createR600VectorRegMerger()
LLVM_ABI char & IfConverterID
IfConverter - This pass performs machine code if conversion.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
FunctionPass * createR600MachineCFGStructurizerPass()
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...