45 Ret +=
"-m:e-S32-p:32:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:32"
46 "-v128:32:32-a:0:32-Fi32-n32";
54 std::optional<Reloc::Model> RM,
55 std::optional<CodeModel::Model> CM,
58 RM.value_or(Reloc::Static),
66 Attribute CPUAttr =
F.getFnAttribute(
"target-cpu");
67 Attribute TuneAttr =
F.getFnAttribute(
"tune-cpu");
68 Attribute FSAttr =
F.getFnAttribute(
"target-features");
77 std::string Key = CPU + TuneCPU + FS;
78 auto &
I = SubtargetMap[Key];
84 I = std::make_unique<CSKYSubtarget>(
TargetTriple, CPU, TuneCPU, FS, *
this);
85 if (
I->useHardFloat() && !
I->hasAnyFloatExt())
86 errs() <<
"Hard-float can't be used with current CPU,"
87 " set to Soft-float\n";
95 return CSKYMachineFunctionInfo::create<CSKYMachineFunctionInfo>(
Allocator,
F,
106 return getTM<CSKYTargetMachine>();
109 void addIRPasses()
override;
110 bool addInstSelector()
override;
111 void addPreEmitPass()
override;
117 return new CSKYPassConfig(*
this, PM);
120void CSKYPassConfig::addIRPasses() {
125bool CSKYPassConfig::addInstSelector() {
131void CSKYPassConfig::addPreEmitPass() {
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeCSKYTarget()
#define LLVM_EXTERNAL_VISIBILITY
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static std::string computeDataLayout()
Target-Independent Code Generator Pass Configuration Options pass.
StringRef getValueAsString() const
Return the attribute's value as a string.
bool isValid() const
Return true if the attribute is any kind of attribute.
Allocate memory in an ever growing pool, as if by bump-pointer.
const CSKYSubtarget * getSubtargetImpl() const =delete
CSKYTargetMachine(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)
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.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A global registry used in conjunction with static constructors to make pluggable components (like tar...
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
std::unique_ptr< const MCSubtargetInfo > STI
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
Target-Independent Code Generator Pass Configuration Options.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
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 ...
This is an optimization pass for GlobalISel generic memory operations.
void initializeCSKYDAGToDAGISelLegacyPass(PassRegistry &)
void initializeCSKYConstantIslandsPass(PassRegistry &)
CodeModel::Model getEffectiveCodeModel(std::optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value.
CodeGenOptLevel
Code generation optimization level.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Target & getTheCSKYTarget()
FunctionPass * createCSKYConstantIslandPass()
Returns a pass that converts branches to long branches.
FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
FunctionPass * createCSKYISelDag(CSKYTargetMachine &TM, CodeGenOptLevel OptLevel)
Implement std::hash so that hash_code can be used in STL containers.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
RegisterTargetMachine - Helper template for registering a target machine implementation,...