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

#include "Target/M68k/M68kInstrInfo.h"

Inheritance diagram for llvm::M68kInstrInfo:
Inheritance graph
[legend]

Public Member Functions

 M68kInstrInfo (const M68kSubtarget &STI)
 
const M68kRegisterInfogetRegisterInfo () const
 TargetInstrInfo is a superset of MRegister info.
 
bool analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
 
bool AnalyzeBranchImpl (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const
 
unsigned removeBranch (MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
 
unsigned insertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
 
void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
 
bool getStackSlotRange (const TargetRegisterClass *RC, unsigned SubIdx, unsigned &Size, unsigned &Offset, const MachineFunction &MF) const override
 
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg, bool IsKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const override
 
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const override
 
bool expandPostRAPseudo (MachineInstr &MI) const override
 
bool isPCRelRegisterOperandLegal (const MachineOperand &MO) const override
 
void AddSExt (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned Reg, MVT From, MVT To) const
 Add appropriate SExt nodes.
 
void AddZExt (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned Reg, MVT From, MVT To) const
 Add appropriate ZExt nodes.
 
bool ExpandMOVI (MachineInstrBuilder &MIB, MVT MVTSize) const
 Move immediate to register.
 
bool ExpandMOVX_RR (MachineInstrBuilder &MIB, MVT MVTDst, MVT MVTSrc) const
 Move across register classes without extension.
 
bool ExpandMOVSZX_RR (MachineInstrBuilder &MIB, bool IsSigned, MVT MVTDst, MVT MVTSrc) const
 Move from register and extend.
 
bool ExpandMOVSZX_RM (MachineInstrBuilder &MIB, bool IsSigned, const MCInstrDesc &Desc, MVT MVTDst, MVT MVTSrc) const
 Move from memory and extend.
 
bool ExpandPUSH_POP (MachineInstrBuilder &MIB, const MCInstrDesc &Desc, bool IsPush) const
 Push/Pop to/from stack.
 
bool ExpandCCR (MachineInstrBuilder &MIB, bool IsToCCR) const
 Moves to/from CCR.
 
bool ExpandMOVEM (MachineInstrBuilder &MIB, const MCInstrDesc &Desc, bool IsRM) const
 Expand all MOVEM pseudos into real MOVEMs.
 
unsigned getGlobalBaseReg (MachineFunction *MF) const
 Return a virtual register initialized with the global base register value.
 
std::pair< unsigned, unsigneddecomposeMachineOperandsTargetFlags (unsigned TF) const override
 
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags () const override
 

Static Public Member Functions

static const M68kInstrInfocreate (M68kSubtarget &STI)
 

Protected Attributes

const M68kSubtargetSubtarget
 
const M68kRegisterInfo RI
 

Detailed Description

Definition at line 237 of file M68kInstrInfo.h.

Constructor & Destructor Documentation

◆ M68kInstrInfo()

M68kInstrInfo::M68kInstrInfo ( const M68kSubtarget STI)
explicit

Definition at line 43 of file M68kInstrInfo.cpp.

Member Function Documentation

◆ AddSExt()

void M68kInstrInfo::AddSExt ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
DebugLoc  DL,
unsigned  Reg,
MVT  From,
MVT  To 
) const

Add appropriate SExt nodes.

Definition at line 313 of file M68kInstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, From, llvm::get(), I, MBB, and RI.

Referenced by ExpandMOVSZX_RM(), and ExpandMOVSZX_RR().

◆ AddZExt()

void M68kInstrInfo::AddZExt ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
DebugLoc  DL,
unsigned  Reg,
MVT  From,
MVT  To 
) const

Add appropriate ZExt nodes.

Definition at line 330 of file M68kInstrInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::And, llvm::BuildMI(), DL, From, llvm::get(), I, and MBB.

Referenced by ExpandMOVSZX_RM(), and ExpandMOVSZX_RR().

◆ analyzeBranch()

bool M68kInstrInfo::analyzeBranch ( MachineBasicBlock MBB,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify 
) const
override

Definition at line 249 of file M68kInstrInfo.cpp.

References AnalyzeBranchImpl(), Cond, MBB, and TBB.

◆ AnalyzeBranchImpl()

bool M68kInstrInfo::AnalyzeBranchImpl ( MachineBasicBlock MBB,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify 
) const

◆ copyPhysReg()

void M68kInstrInfo::copyPhysReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const DebugLoc DL,
MCRegister  DestReg,
MCRegister  SrcReg,
bool  KillSrc 
) const
override

◆ create()

static const M68kInstrInfo * llvm::M68kInstrInfo::create ( M68kSubtarget STI)
static

◆ decomposeMachineOperandsTargetFlags()

std::pair< unsigned, unsigned > M68kInstrInfo::decomposeMachineOperandsTargetFlags ( unsigned  TF) const
override

Definition at line 837 of file M68kInstrInfo.cpp.

◆ ExpandCCR()

bool M68kInstrInfo::ExpandCCR ( MachineInstrBuilder MIB,
bool  IsToCCR 
) const

◆ ExpandMOVEM()

bool M68kInstrInfo::ExpandMOVEM ( MachineInstrBuilder MIB,
const MCInstrDesc Desc,
bool  IsRM 
) const

◆ ExpandMOVI()

bool M68kInstrInfo::ExpandMOVI ( MachineInstrBuilder MIB,
MVT  MVTSize 
) const

◆ ExpandMOVSZX_RM()

bool M68kInstrInfo::ExpandMOVSZX_RM ( MachineInstrBuilder MIB,
bool  IsSigned,
const MCInstrDesc Desc,
MVT  MVTDst,
MVT  MVTSrc 
) const

◆ ExpandMOVSZX_RR()

bool M68kInstrInfo::ExpandMOVSZX_RR ( MachineInstrBuilder MIB,
bool  IsSigned,
MVT  MVTDst,
MVT  MVTSrc 
) const

◆ ExpandMOVX_RR()

bool M68kInstrInfo::ExpandMOVX_RR ( MachineInstrBuilder MIB,
MVT  MVTDst,
MVT  MVTSrc 
) const

◆ expandPostRAPseudo()

bool M68kInstrInfo::expandPostRAPseudo ( MachineInstr MI) const
override

Definition at line 611 of file M68kInstrInfo.cpp.

References Expand2AddrUndef(), ExpandPUSH_POP(), llvm::get(), and MI.

◆ ExpandPUSH_POP()

bool M68kInstrInfo::ExpandPUSH_POP ( MachineInstrBuilder MIB,
const MCInstrDesc Desc,
bool  IsPush 
) const

◆ getGlobalBaseReg()

unsigned M68kInstrInfo::getGlobalBaseReg ( MachineFunction MF) const

Return a virtual register initialized with the global base register value.

Output instructions required to initialize the register in the function entry block, if necessary.

Output instructions required to initialize the register in the function entry block, if necessary.

TODO Move this function to M68kMachineFunctionInfo.

Definition at line 815 of file M68kInstrInfo.cpp.

References llvm::MachineRegisterInfo::createVirtualRegister(), llvm::M68kMachineFunctionInfo::getGlobalBaseReg(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), and llvm::M68kMachineFunctionInfo::setGlobalBaseReg().

◆ getRegisterInfo()

const M68kRegisterInfo & llvm::M68kInstrInfo::getRegisterInfo ( ) const
inline

TargetInstrInfo is a superset of MRegister info.

As such, whenever a client has an instance of instruction info, it should always be able to get register info as well (through this method).

Definition at line 252 of file M68kInstrInfo.h.

References RI.

Referenced by ExpandCCR(), ExpandMOVSZX_RR(), ExpandMOVX_RR(), and llvm::M68kSubtarget::getRegisterInfo().

◆ getSerializableDirectMachineOperandTargetFlags()

ArrayRef< std::pair< unsigned, const char * > > M68kInstrInfo::getSerializableDirectMachineOperandTargetFlags ( ) const
override

Definition at line 842 of file M68kInstrInfo.cpp.

◆ getStackSlotRange()

bool M68kInstrInfo::getStackSlotRange ( const TargetRegisterClass RC,
unsigned  SubIdx,
unsigned Size,
unsigned Offset,
const MachineFunction MF 
) const
override

Definition at line 768 of file M68kInstrInfo.cpp.

References llvm::Offset, and Size.

◆ insertBranch()

unsigned M68kInstrInfo::insertBranch ( MachineBasicBlock MBB,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
ArrayRef< MachineOperand Cond,
const DebugLoc DL,
int *  BytesAdded = nullptr 
) const
override

◆ isPCRelRegisterOperandLegal()

bool M68kInstrInfo::isPCRelRegisterOperandLegal ( const MachineOperand MO) const
override

◆ loadRegFromStackSlot()

void M68kInstrInfo::loadRegFromStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
Register  DestReg,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI,
Register  VReg 
) const
override

◆ removeBranch()

unsigned M68kInstrInfo::removeBranch ( MachineBasicBlock MBB,
int *  BytesRemoved = nullptr 
) const
override

◆ storeRegToStackSlot()

void M68kInstrInfo::storeRegToStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
Register  SrcReg,
bool  IsKill,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI,
Register  VReg 
) const
override

Member Data Documentation

◆ RI

const M68kRegisterInfo llvm::M68kInstrInfo::RI
protected

◆ Subtarget

const M68kSubtarget& llvm::M68kInstrInfo::Subtarget
protected

Definition at line 241 of file M68kInstrInfo.h.

Referenced by loadRegFromStackSlot(), and storeRegToStackSlot().


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