39 std::optional<Reloc::Model>
RM,
40 std::optional<CodeModel::Model> CM,
51 Attribute CPUAttr =
F.getFnAttribute(
"target-cpu");
52 Attribute TuneAttr =
F.getFnAttribute(
"tune-cpu");
53 Attribute FSAttr =
F.getFnAttribute(
"target-features");
62 std::string
Key = CPU + TuneCPU + FS;
63 auto &
I = SubtargetMap[
Key];
69 I = std::make_unique<CSKYSubtarget>(
TargetTriple, CPU, TuneCPU, FS, *
this);
70 if (
I->useHardFloat() && !
I->hasAnyFloatExt())
71 errs() <<
"Hard-float can't be used with current CPU,"
72 " set to Soft-float\n";
94 void addIRPasses()
override;
95 bool addInstSelector()
override;
96 void addPreEmitPass()
override;
102 return new CSKYPassConfig(*
this, PM);
105void CSKYPassConfig::addIRPasses() {
110bool CSKYPassConfig::addInstSelector() {
116void CSKYPassConfig::addPreEmitPass() {
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeCSKYTarget()
#define LLVM_EXTERNAL_VISIBILITY
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
Target-Independent Code Generator Pass Configuration Options pass.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
LLVM_ABI StringRef getValueAsString() const
Return the attribute's value as a string.
bool isValid() const
Return true if the attribute is any kind of attribute.
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.
CodeGenTargetMachineImpl(const Target &T, StringRef DataLayoutString, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI 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.
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
CodeGenOptLevel
Code generation optimization level.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI 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.
LLVM_ABI 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...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
RegisterTargetMachine - Helper template for registering a target machine implementation,...