LLVM 22.0.0git
llvm::M68kInstrInfo Class Reference

#include "Target/M68k/M68kInstrInfo.h"

Inheritance diagram for llvm::M68kInstrInfo:
[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, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) 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, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) 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 45 of file M68kInstrInfo.cpp.

References RI, and Subtarget.

Referenced by create().

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 315 of file M68kInstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, 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 332 of file M68kInstrInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, 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 251 of file M68kInstrInfo.cpp.

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

◆ AnalyzeBranchImpl()

◆ copyPhysReg()

void M68kInstrInfo::copyPhysReg ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator MI,
const DebugLoc & DL,
Register DestReg,
Register SrcReg,
bool KillSrc,
bool RenamableDest = false,
bool RenamableSrc = false ) const
override

◆ create()

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

References M68kInstrInfo().

◆ decomposeMachineOperandsTargetFlags()

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

Definition at line 900 of file M68kInstrInfo.cpp.

◆ ExpandCCR()

◆ ExpandMOVEM()

◆ ExpandMOVI()

◆ ExpandMOVSZX_RM()

◆ ExpandMOVSZX_RR()

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

Move from register and extend.

Expand SExt MOVE pseudos into a MOV and a EXT if the operands are two different registers or just EXT if it is the same register.

Definition at line 472 of file M68kInstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), AddSExt(), AddZExt(), assert(), llvm::BuildMI(), llvm::dbgs(), DL, llvm::MachineInstr::eraseFromParent(), llvm::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstrBuilder::getInstr(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), getRegisterInfo(), LLVM_DEBUG, MBB, RI, and TRI.

◆ ExpandMOVX_RR()

◆ expandPostRAPseudo()

bool M68kInstrInfo::expandPostRAPseudo ( MachineInstr & MI) const
override

Definition at line 654 of file M68kInstrInfo.cpp.

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

◆ ExpandPUSH_POP()

◆ 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 878 of file M68kInstrInfo.cpp.

References 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(), and ExpandMOVX_RR().

◆ getSerializableDirectMachineOperandTargetFlags()

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

Definition at line 905 of file M68kInstrInfo.cpp.

References llvm::ArrayRef().

◆ getStackSlotRange()

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

Definition at line 829 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()

◆ removeBranch()

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

◆ storeRegToStackSlot()

Member Data Documentation

◆ RI

◆ Subtarget

const M68kSubtarget& llvm::M68kInstrInfo::Subtarget
protected

Definition at line 241 of file M68kInstrInfo.h.

Referenced by loadRegFromStackSlot(), M68kInstrInfo(), and storeRegToStackSlot().


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