LLVM 20.0.0git
Public Member Functions | Protected Types | Protected Attributes | List of all members
llvm::M68kSubtarget Class Reference

#include "Target/M68k/M68kSubtarget.h"

Inheritance diagram for llvm::M68kSubtarget:
Inheritance graph
[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.
 
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
 
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 SelectionDAGTargetInfogetSelectionDAGInfo () const override
 
const M68kInstrInfogetInstrInfo () const override
 
const M68kFrameLoweringgetFrameLowering () const override
 
const M68kRegisterInfogetRegisterInfo () const override
 
const M68kTargetLoweringgetTargetLowering () const override
 
const InstrItineraryDatagetInstrItineraryData () 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
 
SelectionDAGTargetInfo TSInfo
 
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< CallLoweringCallLoweringInfo
 
std::unique_ptr< InstructionSelectorInstSelector
 
std::unique_ptr< LegalizerInfoLegalizer
 
std::unique_ptr< RegisterBankInfoRegBankInfo
 

Detailed Description

Definition at line 44 of file M68kSubtarget.h.

Member Enumeration Documentation

◆ FPKindEnum

Enumerator
M881 
M882 

Definition at line 54 of file M68kSubtarget.h.

◆ SubtargetEnum

Enumerator
M00 
M10 
M20 
M30 
M40 
M60 

Definition at line 51 of file M68kSubtarget.h.

Constructor & Destructor Documentation

◆ M68kSubtarget()

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

This constructor initializes the data members to match that of the specified triple.

Definition at line 51 of file M68kSubtarget.cpp.

References CallLoweringInfo, llvm::createM68kInstructionSelector(), getRegisterInfo(), getTargetLowering(), InstSelector, RegBankInfo, and TM.

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

◆ 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 144 of file M68kSubtarget.cpp.

References llvm::M68kII::MO_PC_RELATIVE_ADDRESS.

◆ 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 177 of file M68kSubtarget.cpp.

References classifyLocalReference(), isPositionIndependent(), llvm::M68kII::MO_GOT, llvm::M68kII::MO_GOTPCREL, llvm::TargetMachine::shouldAssumeDSOLocal(), 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

◆ classifyGlobalReference() [1/2]

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

Definition at line 188 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 150 of file M68kSubtarget.cpp.

References atLeastM68020(), llvm::TargetMachine::getCodeModel(), isPositionIndependent(), llvm::CodeModel::Kernel, 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 65 of file M68kSubtarget.cpp.

References CallLoweringInfo.

◆ getFrameLowering()

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

Definition at line 157 of file M68kSubtarget.h.

References FrameLowering.

◆ getInstrInfo()

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

Definition at line 155 of file M68kSubtarget.h.

References InstrInfo.

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

◆ getInstrItineraryData()

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

Definition at line 169 of file M68kSubtarget.h.

References InstrItins.

◆ getInstructionSelector()

InstructionSelector * M68kSubtarget::getInstructionSelector ( ) const
override

Definition at line 69 of file M68kSubtarget.cpp.

References InstSelector.

◆ getJumpTableEncoding()

unsigned M68kSubtarget::getJumpTableEncoding ( ) const

◆ getLegalizerInfo()

const LegalizerInfo * M68kSubtarget::getLegalizerInfo ( ) const
override

Definition at line 73 of file M68kSubtarget.cpp.

◆ getRegBankInfo()

const RegisterBankInfo * M68kSubtarget::getRegBankInfo ( ) const
override

Definition at line 77 of file M68kSubtarget.cpp.

References RegBankInfo.

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

◆ getRegisterInfo()

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

◆ getSelectionDAGInfo()

const SelectionDAGTargetInfo * llvm::M68kSubtarget::getSelectionDAGInfo ( ) const
inlineoverride

Definition at line 151 of file M68kSubtarget.h.

References TSInfo.

◆ getSlotSize()

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

getSlotSize - Stack slot size in bytes.

Definition at line 145 of file M68kSubtarget.h.

Referenced by llvm::M68kFrameLowering::M68kFrameLowering().

◆ 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.

◆ getTargetLowering()

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

Definition at line 165 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 85 of file M68kSubtarget.cpp.

◆ isPositionIndependent()

bool M68kSubtarget::isPositionIndependent ( ) const

◆ isRegisterReservedByUser()

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

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 llvm::Triple::isOSBinFormatELF(), and 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 175 of file M68kSubtarget.h.

Referenced by getCallLowering(), and M68kSubtarget().

◆ FPUKind

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

Definition at line 55 of file M68kSubtarget.h.

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

◆ FrameLowering

M68kFrameLowering llvm::M68kSubtarget::FrameLowering
protected

Definition at line 68 of file M68kSubtarget.h.

Referenced by getFrameLowering().

◆ InstrInfo

M68kInstrInfo llvm::M68kSubtarget::InstrInfo
protected

Definition at line 67 of file M68kSubtarget.h.

Referenced by getInstrInfo(), and getRegisterInfo().

◆ InstrItins

InstrItineraryData llvm::M68kSubtarget::InstrItins
protected

Definition at line 59 of file M68kSubtarget.h.

Referenced by getInstrItineraryData(), and initializeSubtargetDependencies().

◆ InstSelector

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

Definition at line 176 of file M68kSubtarget.h.

Referenced by getInstructionSelector(), and M68kSubtarget().

◆ Legalizer

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

Definition at line 177 of file M68kSubtarget.h.

◆ RegBankInfo

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

Definition at line 178 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 73 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 75 of file M68kSubtarget.h.

Referenced by getTargetTriple(), and isTargetELF().

◆ TLInfo

M68kTargetLowering llvm::M68kSubtarget::TLInfo
protected

Definition at line 69 of file M68kSubtarget.h.

Referenced by getTargetLowering().

◆ TM

const M68kTargetMachine& llvm::M68kSubtarget::TM
protected

◆ TSInfo

SelectionDAGTargetInfo llvm::M68kSubtarget::TSInfo
protected

Definition at line 66 of file M68kSubtarget.h.

Referenced by getSelectionDAGInfo().

◆ UserReservedRegister

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

Definition at line 57 of file M68kSubtarget.h.

Referenced by isRegisterReservedByUser().

◆ UseSmallSection

bool llvm::M68kSubtarget::UseSmallSection = true
protected

Small section is used.

Definition at line 62 of file M68kSubtarget.h.

Referenced by useSmallSection().


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