57 bool Is64Bit,
bool JIT) {
77 std::optional<Reloc::Model>
RM,
78 std::optional<CodeModel::Model> CM,
85 CLOpts(
cl::LibraryOptionsContext::
get<SparcOptions>(
86 Options.MCOptions.LibraryOptions)),
96 const Module *M =
F.getParent();
100 SubtargetAttrs Attrs;
104 Attrs.SoftFloat = FnAttrs.
getAttribute(
"use-soft-float");
106 if (
const SparcSubtarget *ST = LastSubtarget.lookup(FnAttrs, M, Attrs))
112 Attrs.TuneCPU.isValid() ? Attrs.TuneCPU.getValueAsString() : CPU;
119 unsigned FSStart =
Key.size();
125 if (Attrs.SoftFloat.getValueAsBool())
126 Key += FS.empty() ?
"+soft-float" :
",+soft-float";
128 auto &
I = SubtargetMap[
Key];
130 I = std::make_unique<SparcSubtarget>(CPU, TuneCPU,
Key.substr(FSStart),
132 LastSubtarget.set(FnAttrs, M, Attrs,
I.get());
154 void addIRPasses()
override;
155 bool addInstSelector()
override;
156 void addPreEmitPass()
override;
161 return new SparcPassConfig(*
this, PM);
169void SparcPassConfig::addIRPasses() {
175bool SparcPassConfig::addInstSelector() {
181void SparcPassConfig::addPreEmitPass(){
182 if (getSparcTargetMachine().
getCLOpts().enable_branch_relax)
189void SparcV8TargetMachine::anchor() { }
194 std::optional<Reloc::Model>
RM,
195 std::optional<CodeModel::Model> CM,
199void SparcV9TargetMachine::anchor() { }
204 std::optional<Reloc::Model>
RM,
205 std::optional<CodeModel::Model> CM,
209void SparcelTargetMachine::anchor() {}
214 std::optional<Reloc::Model>
RM,
215 std::optional<CodeModel::Model> CM,
static Reloc::Model getEffectiveRelocModel()
#define LLVM_EXTERNAL_VISIBILITY
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
This file defines the SmallString class.
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSparcTarget()
static CodeModel::Model getEffectiveSparcCodeModel(std::optional< CodeModel::Model > CM, Reloc::Model RM, bool Is64Bit, bool JIT)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
Target-Independent Code Generator Pass Configuration Options pass.
This class holds the attributes for a particular argument, parameter, function, or return value.
LLVM_ABI Attribute getAttribute(Attribute::AttrKind Kind) const
Return the attribute object.
CodeGenTargetMachineImpl(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
A Module instance is used to store all the information related to an LLVM module.
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...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
SparcTargetMachine(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)
Create an ILP32 architecture model.
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
const SparcSubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
~SparcTargetMachine() override
SparcV8TargetMachine(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)
SparcV9TargetMachine(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)
SparcelTargetMachine(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)
Represent a constant reference to a string, i.e.
std::unique_ptr< const MCSubtargetInfo > STI
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 ...
Registers T with cl::parseCommandLineOptions.
const AArch64MCOptions & getCLOpts(const MCTargetOptions &Options)
This namespace contains all of the command line option processing machinery.
This is an optimization pass for GlobalISel generic memory operations.
void initializeSparcAsmPrinterPass(PassRegistry &)
Target & getTheSparcTarget()
static Reloc::Model getEffectiveRelocModel(std::optional< Reloc::Model > RM)
void initializeSparcDAGToDAGISelLegacyPass(PassRegistry &)
LLVM_ABI char & BranchRelaxationPassID
BranchRelaxation - This pass replaces branches that need to jump further than is supported by a branc...
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void initializeSparcErrataWorkaroundLegacyPass(PassRegistry &)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
CodeGenOptLevel
Code generation optimization level.
Target & getTheSparcV9Target()
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
FunctionPass * createSparcDAGToDAGISelLegacyPass(SparcTargetMachine &TM, CodeGenOptLevel OptLevel)
createSparcISelDag - This pass converts a legalized DAG into a SPARC-specific DAG,...
FunctionPass * createSparcDelaySlotFillerLegacyPass()
createSparcDelaySlotFillerPass - Returns a pass that fills in delay slots in Sparc MachineFunctions
Target & getTheSparcelTarget()
LLVM_ABI FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
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,...