Go to the documentation of this file.
24 #define DEBUG_TYPE "loongarch"
34 return "e-m:e-p:64:64-i64:64-i128:128-n64-S128";
35 assert(TT.isArch32Bit() &&
"only LA32 and LA64 are currently supported");
36 return "e-m:e-p:32:32-i64:64-n32-S128";
61 Attribute CPUAttr =
F.getFnAttribute(
"target-cpu");
62 Attribute TuneAttr =
F.getFnAttribute(
"tune-cpu");
63 Attribute FSAttr =
F.getFnAttribute(
"target-features");
72 std::string
Key = CPU + TuneCPU +
FS;
73 auto &
I = SubtargetMap[
Key];
80 if (
const MDString *ModuleTargetABI = dyn_cast_or_null<MDString>(
81 F.getParent()->getModuleFlag(
"target-abi"))) {
84 ModuleTargetABI->getString() != ABIName) {
87 ABIName = ModuleTargetABI->getString();
89 I = std::make_unique<LoongArchSubtarget>(
TargetTriple, CPU, TuneCPU,
FS,
102 return getTM<LoongArchTargetMachine>();
105 bool addInstSelector()
override;
111 return new LoongArchPassConfig(*
this, PM);
114 bool LoongArchPassConfig::addInstSelector() {
This is an optimization pass for GlobalISel generic memory operations.
bool isValid() const
Return true if the attribute is any kind of attribute.
static std::string computeDataLayout(const Triple &TT)
Target & getTheLoongArch32Target()
LoongArchTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
Target - Wrapper for Target specific information.
StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
Triple - Helper class for working with autoconf configuration names.
const LoongArchSubtarget * getSubtargetImpl() const =delete
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
MCTargetOptions MCOptions
Machine level options.
RegisterTargetMachine - Helper template for registering a target machine implementation,...
ABI getTargetABI(StringRef ABIName)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
StringRef getValueAsString() const
Return the attribute's value as a string.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
Target-Independent Code Generator Pass Configuration Options.
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
#define LLVM_EXTERNAL_VISIBILITY
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLoongArchTarget()
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
CodeModel::Model getEffectiveCodeModel(Optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
This class describes a target machine that is implemented with the LLVM target-independent code gener...
~LoongArchTargetMachine() override
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
const char LLVMTargetMachineRef TM
FunctionPass * createLoongArchISelDag(LoongArchTargetMachine &TM)
Target & getTheLoongArch64Target()