#include "R600TargetMachine.h"
#include "R600.h"
#include "R600MachineFunctionInfo.h"
#include "R600MachineScheduler.h"
#include "R600TargetTransformInfo.h"
#include "llvm/Transforms/Scalar.h"
#include <optional>
usingnamespacellvm;
static cl::opt<bool>
EnableR600StructurizeCFG("r600-ir-structurize",
cl::desc("Use StructurizeCFG IR pass"),
cl::init(true));
static cl::opt<bool> EnableR600IfConvert("r600-if-convert",
cl::desc("Use if conversion pass"),
cl::ReallyHidden, cl::init(true));
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);
static ScheduleDAGInstrs *createR600MachineScheduler(MachineSchedContext *C) { … }
static MachineSchedRegistry R600SchedRegistry("r600",
"Run R600's custom scheduler",
createR600MachineScheduler);
R600TargetMachine::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 *
R600TargetMachine::getSubtargetImpl(const Function &F) const { … }
TargetTransformInfo
R600TargetMachine::getTargetTransformInfo(const Function &F) const { … }
namespace {
class R600PassConfig final : public AMDGPUPassConfig { … };
}
bool R600PassConfig::addPreISel() { … }
bool R600PassConfig::addInstSelector() { … }
void R600PassConfig::addPreRegAlloc() { … }
void R600PassConfig::addPreSched2() { … }
void R600PassConfig::addPreEmitPass() { … }
TargetPassConfig *R600TargetMachine::createPassConfig(PassManagerBase &PM) { … }
Error R600TargetMachine::buildCodeGenPipeline(
ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
CodeGenFileType FileType, const CGPassBuilderOption &Opts,
PassInstrumentationCallbacks *PIC) { … }
MachineFunctionInfo *R600TargetMachine::createMachineFunctionInfo(
BumpPtrAllocator &Allocator, const Function &F,
const TargetSubtargetInfo *STI) const { … }
R600CodeGenPassBuilder::R600CodeGenPassBuilder(
R600TargetMachine &TM, const CGPassBuilderOption &Opts,
PassInstrumentationCallbacks *PIC)
: … { … }
void R600CodeGenPassBuilder::addPreISel(AddIRPass &addPass) const { … }
void R600CodeGenPassBuilder::addAsmPrinter(AddMachinePass &addPass,
CreateMCStreamer) const { … }
Error R600CodeGenPassBuilder::addInstSelector(AddMachinePass &) const { … }