29 "amdgpu-function-calls",
cl::desc(
"Enable AMDGPU function call support"),
38 "Run R600's custom scheduler",
65 std::optional<Reloc::Model>
RM,
66 std::optional<CodeModel::Model> CM,
80 const Module *M =
F.getParent();
81 if (
const R600Subtarget *ST = LastSubtarget.lookup(FnAttrs, M))
88 if (
const R600Subtarget *ST = LastSubtarget.lookup(FnAttrs, M, Attrs))
92 Attrs.GPU.isValid() ? Attrs.GPU.getValueAsString() :
getTargetCPU();
93 StringRef FS = Attrs.FS.isValid() ? Attrs.FS.getValueAsString()
99 auto &
I = SubtargetMap[SubtargetKey];
101 I = std::make_unique<R600Subtarget>(
TargetTriple, GPU, FS, *
this);
103 LastSubtarget.set(FnAttrs, M, Attrs,
I.get());
123 bool addPreISel()
override;
124 bool addInstSelector()
override;
125 void addPreRegAlloc()
override;
126 void addPreSched2()
override;
127 void addPreEmitPass()
override;
135bool R600PassConfig::addPreISel() {
138 if (CLOpts.r600_ir_structurize)
143bool R600PassConfig::addInstSelector() {
150void R600PassConfig::addPreSched2() {
152 if (CLOpts.r600_if_convert)
157void R600PassConfig::addPreEmitPass() {
165 return new R600PassConfig(*
this, PM);
192 Opt.RequiresCodeGenSCCOrder =
true;
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
Interfaces for producing common pass manager configurations.
ModuleAnalysisManager MAM
PassInstrumentationCallbacks PIC
R600 Machine Scheduler interface.
static ScheduleDAGInstrs * createR600MachineScheduler(MachineSchedContext *C)
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.
void addAsmPrinter(PassManagerWrapper &PMW) override
void addAsmPrinterBegin(PassManagerWrapper &PMW) override
Error addInstSelector(PassManagerWrapper &PMW) override
addInstSelector - This method should install an instruction selector pass, which converts from LLVM c...
void addPreISel(PassManagerWrapper &PMW) override
{{@ For GlobalISel
void addAsmPrinterEnd(PassManagerWrapper &PMW) override
R600CodeGenPassBuilder(R600TargetMachine &TM, const CGPassBuilderOption &Opts, PassInstrumentationCallbacks *PIC)
bool addPreISel() override
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where t...
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)
This class holds the attributes for a particular argument, parameter, function, or return value.
LLVM_ABI Attribute getAttribute(Attribute::AttrKind Kind) const
Return the attribute object.
CodeGenPassBuilder(TargetMachine &TM, const CGPassBuilderOption &Opts, PassInstrumentationCallbacks *PIC)
Error buildPipeline(ModulePassManager &MPM, ModuleAnalysisManager &MAM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Ctx)
PassInstrumentationCallbacks * PIC
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Context object for machine code objects.
MachineSchedRegistry provides a selection of available machine instruction schedulers.
A Module instance is used to store all the information related to an LLVM module.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
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)
const TargetSubtargetInfo * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Error buildCodeGenPipeline(ModulePassManager &MPM, ModuleAnalysisManager &MAM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, const CGPassBuilderOption &Opt, MCContext &Ctx, PassInstrumentationCallbacks *PIC) override
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
ScheduleDAGInstrs * createMachineScheduler(MachineSchedContext *C) const override
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this ...
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
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.
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.
StringRef getTargetFeatureString() const
StringRef getTargetCPU() const
void setRequiresStructuredCFG(bool Value)
std::unique_ptr< const MCSubtargetInfo > STI
Target-Independent Code Generator Pass Configuration Options.
TargetSubtargetInfo - Generic base class for all target subtargets.
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.
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()
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
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...