LLVM 22.0.0git
llvm::M68kSubtarget Class Reference

#include "Target/M68k/M68kSubtarget.h"

Inheritance diagram for llvm::M68kSubtarget:
[legend]

Public Member Functions

 M68kSubtarget (const Triple &TT, StringRef CPU, StringRef FS, const M68kTargetMachine &_TM)
 This constructor initializes the data members to match that of the specified triple.
 ~M68kSubtarget () override
void ParseSubtargetFeatures (StringRef CPU, StringRef TuneCPU, StringRef FS)
 Parses features string setting specified subtarget options.
bool atLeastM68000 () const
bool atLeastM68010 () const
bool atLeastM68020 () const
bool atLeastM68030 () const
bool atLeastM68040 () const
bool atLeastM68060 () const
bool hasFPU () const
 Floating point support.
bool atLeastM68881 () const
bool atLeastM68882 () const
bool useSmallSection () const
const TriplegetTargetTriple () const
bool isTargetELF () const
bool isLegalToCallImmediateAddr () const
 Return true if the subtarget allows calls to immediate address.
bool isPositionIndependent () const
bool isRegisterReservedByUser (Register R) const override
unsigned char classifyLocalReference (const GlobalValue *GV) const
 Classify a global variable reference for the current subtarget according to how we should reference it in a non-pcrel context.
unsigned char classifyGlobalReference (const GlobalValue *GV, const Module &M) const
 Classify a global variable reference for the current subtarget according to how we should reference it in a non-pcrel context.
unsigned char classifyGlobalReference (const GlobalValue *GV) const
unsigned char classifyExternalReference (const Module &M) const
 Classify a external variable reference for the current subtarget according to how we should reference it in a non-pcrel context.
unsigned char classifyGlobalFunctionReference (const GlobalValue *GV, const Module &M) const
 Classify a global function reference for the current subtarget.
unsigned char classifyGlobalFunctionReference (const GlobalValue *GV) const override
unsigned char classifyBlockAddressReference () const
 Classify a blockaddress reference for the current subtarget according to how we should reference it in a non-pcrel context.
unsigned getJumpTableEncoding () const
Align getStackAlignment () const
 TODO this must be controlled by options like -malign-int and -mshort.
unsigned getSlotSize () const
 getSlotSize - Stack slot size in bytes.
M68kSubtargetinitializeSubtargetDependencies (StringRef CPU, Triple TT, StringRef FS, const M68kTargetMachine &TM)
const M68kInstrInfogetInstrInfo () const override
const M68kFrameLoweringgetFrameLowering () const override
const M68kRegisterInfogetRegisterInfo () const override
const M68kTargetLoweringgetTargetLowering () const override
const InstrItineraryDatagetInstrItineraryData () const override
const SelectionDAGTargetInfogetSelectionDAGInfo () const override
const CallLoweringgetCallLowering () const override
InstructionSelectorgetInstructionSelector () const override
const LegalizerInfogetLegalizerInfo () const override
const RegisterBankInfogetRegBankInfo () const override

Protected Types

enum  SubtargetEnum {
  M00 , M10 , M20 , M30 ,
  M40 , M60
}
enum  FPKindEnum { M881 , M882 }

Protected Attributes

SubtargetEnum SubtargetKind = M00
std::optional< FPKindEnumFPUKind
std::bitset< M68k::NUM_TARGET_REGS > UserReservedRegister
InstrItineraryData InstrItins
bool UseSmallSection = true
 Small section is used.
const M68kTargetMachineTM
M68kInstrInfo InstrInfo
M68kFrameLowering FrameLowering
M68kTargetLowering TLInfo
unsigned stackAlignment = 8
 The minimum alignment known to hold of the stack frame on entry to the function and which must be maintained by every function.
Triple TargetTriple
std::unique_ptr< const SelectionDAGTargetInfoTSInfo
std::unique_ptr< CallLoweringCallLoweringInfo
std::unique_ptr< InstructionSelectorInstSelector
std::unique_ptr< LegalizerInfoLegalizer
std::unique_ptr< RegisterBankInfoRegBankInfo

Detailed Description

Definition at line 43 of file M68kSubtarget.h.

Member Enumeration Documentation

◆ FPKindEnum

Enumerator
M881 
M882 

Definition at line 53 of file M68kSubtarget.h.

◆ SubtargetEnum

Enumerator
M00 
M10 
M20 
M30 
M40 
M60 

Definition at line 50 of file M68kSubtarget.h.

Constructor & Destructor Documentation

◆ M68kSubtarget()

M68kSubtarget::M68kSubtarget ( const Triple & TT,
StringRef CPU,
StringRef FS,
const M68kTargetMachine & _TM )

◆ ~M68kSubtarget()

M68kSubtarget::~M68kSubtarget ( )
overridedefault

Member Function Documentation

◆ atLeastM68000()

bool llvm::M68kSubtarget::atLeastM68000 ( ) const
inline

Definition at line 87 of file M68kSubtarget.h.

References M00, and SubtargetKind.

◆ atLeastM68010()

bool llvm::M68kSubtarget::atLeastM68010 ( ) const
inline

Definition at line 88 of file M68kSubtarget.h.

References M10, and SubtargetKind.

◆ atLeastM68020()

bool llvm::M68kSubtarget::atLeastM68020 ( ) const
inline

Definition at line 89 of file M68kSubtarget.h.

References M20, and SubtargetKind.

Referenced by classifyGlobalReference(), classifyLocalReference(), and getJumpTableEncoding().

◆ atLeastM68030()

bool llvm::M68kSubtarget::atLeastM68030 ( ) const
inline

Definition at line 90 of file M68kSubtarget.h.

References M30, and SubtargetKind.

◆ atLeastM68040()

bool llvm::M68kSubtarget::atLeastM68040 ( ) const
inline

Definition at line 91 of file M68kSubtarget.h.

References M40, and SubtargetKind.

◆ atLeastM68060()

bool llvm::M68kSubtarget::atLeastM68060 ( ) const
inline

Definition at line 92 of file M68kSubtarget.h.

References M60, and SubtargetKind.

◆ atLeastM68881()

bool llvm::M68kSubtarget::atLeastM68881 ( ) const
inline

Definition at line 96 of file M68kSubtarget.h.

References FPUKind, hasFPU(), and M881.

◆ atLeastM68882()

bool llvm::M68kSubtarget::atLeastM68882 ( ) const
inline

Definition at line 97 of file M68kSubtarget.h.

References FPUKind, hasFPU(), and M882.

◆ classifyBlockAddressReference()

unsigned char M68kSubtarget::classifyBlockAddressReference ( ) const

Classify a blockaddress reference for the current subtarget according to how we should reference it in a non-pcrel context.

Definition at line 169 of file M68kSubtarget.cpp.

References isPositionIndependent(), llvm::CodeModel::Kernel, llvm::CodeModel::Large, llvm_unreachable, llvm::CodeModel::Medium, llvm::M68kII::MO_ABSOLUTE_ADDRESS, llvm::M68kII::MO_PC_RELATIVE_ADDRESS, llvm::CodeModel::Small, and TM.

◆ classifyExternalReference()

unsigned char M68kSubtarget::classifyExternalReference ( const Module & M) const

Classify a external variable reference for the current subtarget according to how we should reference it in a non-pcrel context.

Definition at line 223 of file M68kSubtarget.cpp.

References classifyLocalReference(), isPositionIndependent(), llvm::M68kII::MO_GOT, llvm::M68kII::MO_GOTPCREL, and TM.

◆ classifyGlobalFunctionReference() [1/2]

unsigned char M68kSubtarget::classifyGlobalFunctionReference ( const GlobalValue * GV) const
override

◆ classifyGlobalFunctionReference() [2/2]

unsigned char M68kSubtarget::classifyGlobalFunctionReference ( const GlobalValue * GV,
const Module & M ) const

Classify a global function reference for the current subtarget.

Definition at line 293 of file M68kSubtarget.cpp.

References llvm::dyn_cast_or_null(), F, isPositionIndependent(), llvm::M68kII::MO_ABSOLUTE_ADDRESS, llvm::M68kII::MO_GOTPCREL, llvm::M68kII::MO_NO_FLAG, llvm::M68kII::MO_PLT, and TM.

Referenced by classifyGlobalFunctionReference().

◆ classifyGlobalReference() [1/2]

unsigned char M68kSubtarget::classifyGlobalReference ( const GlobalValue * GV) const

Definition at line 234 of file M68kSubtarget.cpp.

References classifyGlobalReference(), and llvm::GlobalValue::getParent().

◆ classifyGlobalReference() [2/2]

unsigned char M68kSubtarget::classifyGlobalReference ( const GlobalValue * GV,
const Module & M ) const

◆ classifyLocalReference()

unsigned char M68kSubtarget::classifyLocalReference ( const GlobalValue * GV) const

Classify a global variable reference for the current subtarget according to how we should reference it in a non-pcrel context.

Definition at line 189 of file M68kSubtarget.cpp.

References atLeastM68020(), isPositionIndependent(), llvm::CodeModel::Kernel, llvm::CodeModel::Large, llvm_unreachable, llvm::CodeModel::Medium, llvm::M68kII::MO_ABSOLUTE_ADDRESS, llvm::M68kII::MO_GOTOFF, llvm::M68kII::MO_PC_RELATIVE_ADDRESS, llvm::CodeModel::Small, and TM.

Referenced by classifyExternalReference(), and classifyGlobalReference().

◆ getCallLowering()

const CallLowering * M68kSubtarget::getCallLowering ( ) const
override

Definition at line 72 of file M68kSubtarget.cpp.

References CallLoweringInfo.

◆ getFrameLowering()

const M68kFrameLowering * llvm::M68kSubtarget::getFrameLowering ( ) const
inlineoverride

Definition at line 153 of file M68kSubtarget.h.

References FrameLowering.

◆ getInstrInfo()

const M68kInstrInfo * llvm::M68kSubtarget::getInstrInfo ( ) const
inlineoverride

Definition at line 151 of file M68kSubtarget.h.

References InstrInfo.

Referenced by llvm::M68kCallLowering::lowerCall().

◆ getInstrItineraryData()

const InstrItineraryData * llvm::M68kSubtarget::getInstrItineraryData ( ) const
inlineoverride

Definition at line 165 of file M68kSubtarget.h.

References InstrItins.

◆ getInstructionSelector()

InstructionSelector * M68kSubtarget::getInstructionSelector ( ) const
override

Definition at line 76 of file M68kSubtarget.cpp.

References InstSelector.

◆ getJumpTableEncoding()

◆ getLegalizerInfo()

const LegalizerInfo * M68kSubtarget::getLegalizerInfo ( ) const
override

Definition at line 80 of file M68kSubtarget.cpp.

References Legalizer.

◆ getRegBankInfo()

const RegisterBankInfo * M68kSubtarget::getRegBankInfo ( ) const
override

Definition at line 84 of file M68kSubtarget.cpp.

References RegBankInfo.

Referenced by llvm::M68kCallLowering::lowerCall().

◆ getRegisterInfo()

const M68kRegisterInfo * llvm::M68kSubtarget::getRegisterInfo ( ) const
inlineoverride

◆ getSelectionDAGInfo()

const SelectionDAGTargetInfo * M68kSubtarget::getSelectionDAGInfo ( ) const
override

Definition at line 68 of file M68kSubtarget.cpp.

References TSInfo.

◆ getSlotSize()

unsigned llvm::M68kSubtarget::getSlotSize ( ) const
inline

getSlotSize - Stack slot size in bytes.

Definition at line 145 of file M68kSubtarget.h.

◆ getStackAlignment()

Align llvm::M68kSubtarget::getStackAlignment ( ) const
inline

TODO this must be controlled by options like -malign-int and -mshort.

Definition at line 142 of file M68kSubtarget.h.

References stackAlignment.

Referenced by M68kSubtarget().

◆ getTargetLowering()

const M68kTargetLowering * llvm::M68kSubtarget::getTargetLowering ( ) const
inlineoverride

Definition at line 161 of file M68kSubtarget.h.

References TLInfo.

Referenced by M68kSubtarget().

◆ getTargetTriple()

const Triple & llvm::M68kSubtarget::getTargetTriple ( ) const
inline

Definition at line 101 of file M68kSubtarget.h.

References TargetTriple.

◆ hasFPU()

bool llvm::M68kSubtarget::hasFPU ( ) const
inline

Floating point support.

Definition at line 95 of file M68kSubtarget.h.

References FPUKind.

Referenced by atLeastM68881(), and atLeastM68882().

◆ initializeSubtargetDependencies()

M68kSubtarget & M68kSubtarget::initializeSubtargetDependencies ( StringRef CPU,
Triple TT,
StringRef FS,
const M68kTargetMachine & TM )

◆ isLegalToCallImmediateAddr()

bool M68kSubtarget::isLegalToCallImmediateAddr ( ) const

Return true if the subtarget allows calls to immediate address.

Definition at line 92 of file M68kSubtarget.cpp.

◆ isPositionIndependent()

◆ isRegisterReservedByUser()

bool llvm::M68kSubtarget::isRegisterReservedByUser ( Register R) const
inlineoverride

Definition at line 110 of file M68kSubtarget.h.

References assert(), and UserReservedRegister.

Referenced by llvm::M68kRegisterInfo::getReservedRegs().

◆ isTargetELF()

bool llvm::M68kSubtarget::isTargetELF ( ) const
inline

Definition at line 103 of file M68kSubtarget.h.

References TargetTriple.

◆ ParseSubtargetFeatures()

void llvm::M68kSubtarget::ParseSubtargetFeatures ( StringRef CPU,
StringRef TuneCPU,
StringRef FS )

Parses features string setting specified subtarget options.

Definition of function is auto generated by tblgen.

Referenced by initializeSubtargetDependencies().

◆ useSmallSection()

bool llvm::M68kSubtarget::useSmallSection ( ) const
inline

Definition at line 99 of file M68kSubtarget.h.

References UseSmallSection.

Member Data Documentation

◆ CallLoweringInfo

std::unique_ptr<CallLowering> llvm::M68kSubtarget::CallLoweringInfo
protected

Definition at line 174 of file M68kSubtarget.h.

Referenced by getCallLowering(), and M68kSubtarget().

◆ FPUKind

std::optional<FPKindEnum> llvm::M68kSubtarget::FPUKind
protected

Definition at line 54 of file M68kSubtarget.h.

Referenced by atLeastM68881(), atLeastM68882(), and hasFPU().

◆ FrameLowering

M68kFrameLowering llvm::M68kSubtarget::FrameLowering
protected

Definition at line 66 of file M68kSubtarget.h.

Referenced by getFrameLowering(), and M68kSubtarget().

◆ InstrInfo

M68kInstrInfo llvm::M68kSubtarget::InstrInfo
protected

Definition at line 65 of file M68kSubtarget.h.

Referenced by getInstrInfo(), getRegisterInfo(), and M68kSubtarget().

◆ InstrItins

InstrItineraryData llvm::M68kSubtarget::InstrItins
protected

Definition at line 58 of file M68kSubtarget.h.

Referenced by getInstrItineraryData(), and initializeSubtargetDependencies().

◆ InstSelector

std::unique_ptr<InstructionSelector> llvm::M68kSubtarget::InstSelector
protected

Definition at line 175 of file M68kSubtarget.h.

Referenced by getInstructionSelector(), and M68kSubtarget().

◆ Legalizer

std::unique_ptr<LegalizerInfo> llvm::M68kSubtarget::Legalizer
protected

Definition at line 176 of file M68kSubtarget.h.

Referenced by getLegalizerInfo(), and M68kSubtarget().

◆ RegBankInfo

std::unique_ptr<RegisterBankInfo> llvm::M68kSubtarget::RegBankInfo
protected

Definition at line 177 of file M68kSubtarget.h.

Referenced by getRegBankInfo(), and M68kSubtarget().

◆ stackAlignment

unsigned llvm::M68kSubtarget::stackAlignment = 8
protected

The minimum alignment known to hold of the stack frame on entry to the function and which must be maintained by every function.

Definition at line 71 of file M68kSubtarget.h.

Referenced by getStackAlignment(), and initializeSubtargetDependencies().

◆ SubtargetKind

SubtargetEnum llvm::M68kSubtarget::SubtargetKind = M00
protected

◆ TargetTriple

Triple llvm::M68kSubtarget::TargetTriple
protected

Definition at line 73 of file M68kSubtarget.h.

Referenced by getTargetTriple(), isTargetELF(), and M68kSubtarget().

◆ TLInfo

M68kTargetLowering llvm::M68kSubtarget::TLInfo
protected

Definition at line 67 of file M68kSubtarget.h.

Referenced by getTargetLowering(), and M68kSubtarget().

◆ TM

◆ TSInfo

std::unique_ptr<const SelectionDAGTargetInfo> llvm::M68kSubtarget::TSInfo
protected

Definition at line 171 of file M68kSubtarget.h.

Referenced by getSelectionDAGInfo(), and M68kSubtarget().

◆ UserReservedRegister

std::bitset<M68k::NUM_TARGET_REGS> llvm::M68kSubtarget::UserReservedRegister
protected

Definition at line 56 of file M68kSubtarget.h.

Referenced by isRegisterReservedByUser().

◆ UseSmallSection

bool llvm::M68kSubtarget::UseSmallSection = true
protected

Small section is used.

Definition at line 61 of file M68kSubtarget.h.

Referenced by useSmallSection().


The documentation for this class was generated from the following files: