#include "SystemZTargetMachine.h"
#include "MCTargetDesc/SystemZMCTargetDesc.h"
#include "SystemZ.h"
#include "SystemZMachineFunctionInfo.h"
#include "SystemZMachineScheduler.h"
#include "SystemZTargetObjectFile.h"
#include "SystemZTargetTransformInfo.h"
#include "TargetInfo/SystemZTargetInfo.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Transforms/Scalar.h"
#include <memory>
#include <optional>
#include <string>
usingnamespacellvm;
static cl::opt<bool> EnableMachineCombinerPass(
"systemz-machine-combiner",
cl::desc("Enable the machine combiner pass"),
cl::init(true), cl::Hidden);
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSystemZTarget() { … }
static std::string computeDataLayout(const Triple &TT) { … }
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) { … }
static Reloc::Model getEffectiveRelocModel(std::optional<Reloc::Model> RM) { … }
static CodeModel::Model
getEffectiveSystemZCodeModel(std::optional<CodeModel::Model> CM,
Reloc::Model RM, bool JIT) { … }
SystemZTargetMachine::SystemZTargetMachine(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)
: … { … }
SystemZTargetMachine::~SystemZTargetMachine() = default;
const SystemZSubtarget *
SystemZTargetMachine::getSubtargetImpl(const Function &F) const { … }
namespace {
class SystemZPassConfig : public TargetPassConfig { … };
}
void SystemZPassConfig::addIRPasses() { … }
bool SystemZPassConfig::addInstSelector() { … }
bool SystemZPassConfig::addILPOpts() { … }
void SystemZPassConfig::addPreRegAlloc() { … }
void SystemZPassConfig::addPostRewrite() { … }
void SystemZPassConfig::addPostRegAlloc() { … }
void SystemZPassConfig::addPreSched2() { … }
void SystemZPassConfig::addPreEmitPass() { … }
TargetPassConfig *SystemZTargetMachine::createPassConfig(PassManagerBase &PM) { … }
TargetTransformInfo
SystemZTargetMachine::getTargetTransformInfo(const Function &F) const { … }
MachineFunctionInfo *SystemZTargetMachine::createMachineFunctionInfo(
BumpPtrAllocator &Allocator, const Function &F,
const TargetSubtargetInfo *STI) const { … }