#include "LanaiTargetMachine.h"
#include "Lanai.h"
#include "LanaiMachineFunctionInfo.h"
#include "LanaiTargetObjectFile.h"
#include "LanaiTargetTransformInfo.h"
#include "TargetInfo/LanaiTargetInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Target/TargetOptions.h"
#include <optional>
usingnamespacellvm;
namespace llvm {
void initializeLanaiMemAluCombinerPass(PassRegistry &);
}
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLanaiTarget() { … }
static std::string computeDataLayout() { … }
static Reloc::Model getEffectiveRelocModel(std::optional<Reloc::Model> RM) { … }
LanaiTargetMachine::LanaiTargetMachine(
const Target &T, const Triple &TT, StringRef Cpu, StringRef FeatureString,
const TargetOptions &Options, std::optional<Reloc::Model> RM,
std::optional<CodeModel::Model> CodeModel, CodeGenOptLevel OptLevel,
bool JIT)
: … { … }
TargetTransformInfo
LanaiTargetMachine::getTargetTransformInfo(const Function &F) const { … }
MachineFunctionInfo *LanaiTargetMachine::createMachineFunctionInfo(
BumpPtrAllocator &Allocator, const Function &F,
const TargetSubtargetInfo *STI) const { … }
namespace {
class LanaiPassConfig : public TargetPassConfig { … };
}
TargetPassConfig *
LanaiTargetMachine::createPassConfig(PassManagerBase &PassManager) { … }
void LanaiPassConfig::addIRPasses() { … }
bool LanaiPassConfig::addInstSelector() { … }
void LanaiPassConfig::addPreEmitPass() { … }
void LanaiPassConfig::addPreSched2() { … }