Go to the documentation of this file.
35 #define DEBUG_TYPE "m68k"
63 Ret +=
"-i8:8:8-i16:16:16-i32:16:32";
76 std::optional<Reloc::Model>
RM) {
100 std::optional<Reloc::Model>
RM,
101 std::optional<CodeModel::Model> CM,
107 Subtarget(TT, CPU,
FS, *
this) {
115 Attribute CPUAttr =
F.getFnAttribute(
"target-cpu");
116 Attribute FSAttr =
F.getFnAttribute(
"target-features");
121 auto &
I = SubtargetMap[CPU +
FS];
135 return M68kMachineFunctionInfo::create<M68kMachineFunctionInfo>(
Allocator,
F,
150 return getTM<M68kTargetMachine>();
154 return *getM68kTargetMachine().getSubtargetImpl();
156 void addIRPasses()
override;
157 bool addIRTranslator()
override;
158 bool addLegalizeMachineIR()
override;
159 bool addRegBankSelect()
override;
160 bool addGlobalInstructionSelect()
override;
161 bool addInstSelector()
override;
162 void addPreSched2()
override;
163 void addPreEmitPass()
override;
168 return new M68kPassConfig(*
this, PM);
171 void M68kPassConfig::addIRPasses() {
176 bool M68kPassConfig::addInstSelector() {
183 bool M68kPassConfig::addIRTranslator() {
188 bool M68kPassConfig::addLegalizeMachineIR() {
193 bool M68kPassConfig::addRegBankSelect() {
198 bool M68kPassConfig::addGlobalInstructionSelect() {
205 void M68kPassConfig::addPreEmitPass() {
This is an optimization pass for GlobalISel generic memory operations.
bool isValid() const
Return true if the attribute is any kind of attribute.
std::unique_ptr< const MCSubtargetInfo > STI
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Target & getTheM68kTarget()
void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
void initializeM68kDAGToDAGISelPass(PassRegistry &)
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
FunctionPass * createM68kCollapseMOVEMPass()
Finds sequential MOVEM instruction and collapse them into a single one.
FunctionPass * createAtomicExpandPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
This pass is responsible for selecting generic machine instructions to target-specific instructions.
RegisterTargetMachine - Helper template for registering a target machine implementation,...
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
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.
const M68kSubtarget * getSubtargetImpl() const
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
M68kTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
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.
#define LLVM_EXTERNAL_VISIBILITY
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
Allocate memory in an ever growing pool, as if by bump-pointer.
static std::string computeDataLayout(const Triple &TT, const MCTargetOptions &Options, bool LittleEndian)
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
static Reloc::Model getEffectiveRelocModel(std::optional< Reloc::Model > RM)
StringRef - Represent a constant reference to a string, i.e.
Analysis the ScalarEvolution expression for r is this
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
FunctionPass * createM68kISelDag(M68kTargetMachine &TM)
This pass converts a legalized DAG into a M68k-specific DAG, ready for instruction scheduling.
TargetSubtargetInfo - Generic base class for all target subtargets.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kTarget()
This class describes a target machine that is implemented with the LLVM target-independent code gener...
FunctionPass * createM68kExpandPseudoPass()
Return a Machine IR pass that expands M68k-specific pseudo instructions into a sequence of actual ins...
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
std::string str() const
str - Get the contents as an std::string.
const char LLVMTargetMachineRef TM
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
Level
Code generation optimization level.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
FunctionPass * createM68kGlobalBaseRegPass()
This pass initializes a global base register for PIC on M68k.
~M68kTargetMachine() override