23 #define DEBUG_TYPE "nios2" 31 return "e-p:32:32:32-i8:8:32-i16:16:32-n32";
58 Subtarget(TT, CPU, FS, *this) {
76 auto &
I = SubtargetMap[CPU + FS];
82 I = llvm::make_unique<Nios2Subtarget>(
TargetTriple, CPU, FS, *
this);
95 return getTM<Nios2TargetMachine>();
98 void addCodeGenPrepare()
override;
99 bool addInstSelector()
override;
100 void addIRPasses()
override;
105 return new Nios2PassConfig(*
this, &PM);
108 void Nios2PassConfig::addCodeGenPrepare() {
116 bool Nios2PassConfig::addInstSelector() {
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Compute iterated dominance frontiers using a linear time algorithm.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&... args)
Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object...
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
Target & getTheNios2Target()
No attributes have been set.
Target-Independent Code Generator Pass Configuration Options.
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
void LLVMInitializeNios2Target()
static CodeModel::Model getEffectiveCodeModel(Optional< CodeModel::Model > CM)
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
This class describes a target machine that is implemented with the LLVM target-independent code gener...
~Nios2TargetMachine() override
Nios2TargetMachine(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)
virtual void addCodeGenPrepare()
Add pass to prepare the LLVM IR for code generation.
Triple - Helper class for working with autoconf configuration names.
const Nios2Subtarget * getSubtargetImpl() const
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
FunctionPass * createNios2ISelDag(Nios2TargetMachine &TM, CodeGenOpt::Level OptLevel)
Target - Wrapper for Target specific information.
StringRef getValueAsString() const
Return the attribute's value as a string.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
StringRef - Represent a constant reference to a string, i.e.
static std::string computeDataLayout()