|
LLVM
4.0.0
|
#include <Mips16InstrInfo.h>
Public Member Functions | |
| Mips16InstrInfo (const MipsSubtarget &STI) | |
| const MipsRegisterInfo & | getRegisterInfo () const override |
| getRegisterInfo - TargetInstrInfo is a superset of MRegister info. More... | |
| unsigned | isLoadFromStackSlot (const MachineInstr &MI, int &FrameIndex) const override |
| isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot, return the virtual or physical register number of the destination along with the FrameIndex of the loaded stack slot. More... | |
| unsigned | isStoreToStackSlot (const MachineInstr &MI, int &FrameIndex) const override |
| isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot, return the virtual or physical register number of the source reg along with the FrameIndex of the loaded stack slot. More... | |
| void | copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override |
| void | storeRegToStack (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const override |
| void | loadRegFromStack (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const override |
| bool | expandPostRAPseudo (MachineInstr &MI) const override |
| unsigned | getOppositeBranchOpc (unsigned Opc) const override |
| GetOppositeBranchOpc - Return the inverse of the specified opcode, e.g. More... | |
| void | makeFrame (unsigned SP, int64_t FrameSize, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const |
| void | restoreFrame (unsigned SP, int64_t FrameSize, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const |
| void | adjustStackPtr (unsigned SP, int64_t Amount, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override |
| Adjust SP by Amount bytes. More... | |
| unsigned | loadImmediate (unsigned FrameReg, int64_t Imm, MachineBasicBlock &MBB, MachineBasicBlock::iterator II, const DebugLoc &DL, unsigned &NewImm) const |
| Emit a series of instructions to load an immediate. More... | |
| const MCInstrDesc & | AddiuSpImm (int64_t Imm) const |
| void | BuildAddiuSpImm (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, int64_t Imm) const |
| unsigned | getInlineAsmLength (const char *Str, const MCAsmInfo &MAI) const override |
| Measure the specified inline asm to determine an approximation of its length. More... | |
Public Member Functions inherited from llvm::MipsInstrInfo | |
| MipsInstrInfo (const MipsSubtarget &STI, unsigned UncondBrOpc) | |
| bool | analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override |
| Branch Analysis. More... | |
| 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 |
| bool | reverseBranchCondition (SmallVectorImpl< MachineOperand > &Cond) const override |
| reverseBranchCondition - Return the inverse opcode of the specified Branch instruction. More... | |
| BranchType | analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify, SmallVectorImpl< MachineInstr * > &BranchInstrs) const |
| unsigned | getEquivalentCompactForm (const MachineBasicBlock::iterator I) const |
| Determine the opcode of a non-delay slot form for a branch if one exists. More... | |
| bool | SafeInForbiddenSlot (const MachineInstr &MI) const |
| Predicate to determine if an instruction can go in a forbidden slot. More... | |
| bool | HasForbiddenSlot (const MachineInstr &MI) const |
| Predicate to determine if an instruction has a forbidden slot. More... | |
| void | insertNoop (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override |
| Insert nop instruction when hazard condition is found. More... | |
| unsigned | getInstSizeInBytes (const MachineInstr &MI) const override |
| Return the number of bytes of code the specified instruction may be. More... | |
| void | storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override |
| void | loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override |
| MachineInstrBuilder | genInstrWithNewOpc (unsigned NewOpc, MachineBasicBlock::iterator I) const |
| Create an instruction which has the same operands and memory operands as MI but has a new opcode. More... | |
Static Public Member Functions | |
| static bool | validImmediate (unsigned Opcode, unsigned Reg, int64_t Amount) |
| static bool | validSpImm8 (int offset) |
Static Public Member Functions inherited from llvm::MipsInstrInfo | |
| static const MipsInstrInfo * | create (MipsSubtarget &STI) |
Additional Inherited Members | |
Public Types inherited from llvm::MipsInstrInfo | |
| enum | BranchType { BT_None, BT_NoBranch, BT_Uncond, BT_Cond, BT_CondUncond, BT_Indirect } |
Protected Member Functions inherited from llvm::MipsInstrInfo | |
| bool | isZeroImm (const MachineOperand &op) const |
| MachineMemOperand * | GetMemOperand (MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const |
Protected Attributes inherited from llvm::MipsInstrInfo | |
| const MipsSubtarget & | Subtarget |
| unsigned | UncondBrOpc |
Definition at line 22 of file Mips16InstrInfo.h.
|
explicit |
Definition at line 32 of file Mips16InstrInfo.cpp.
| const MCInstrDesc & Mips16InstrInfo::AddiuSpImm | ( | int64_t | Imm | ) | const |
Definition at line 439 of file Mips16InstrInfo.cpp.
References validSpImm8().
|
overridevirtual |
Adjust SP by Amount bytes.
Implements llvm::MipsInstrInfo.
Definition at line 291 of file Mips16InstrInfo.cpp.
References BuildAddiuSpImm(), and llvm::isInt< 16 >().
| void Mips16InstrInfo::BuildAddiuSpImm | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | I, | ||
| int64_t | Imm | ||
| ) | const |
Definition at line 447 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), and llvm::BuildMI().
Referenced by adjustStackPtr(), makeFrame(), and restoreFrame().
|
override |
Definition at line 59 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), llvm::RegState::Define, and llvm::getKillRegState().
Referenced by loadImmediate().
|
override |
Definition at line 127 of file Mips16InstrInfo.cpp.
References llvm::MachineBasicBlock::erase(), llvm::MachineInstr::getDesc(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MCInstrDesc::getOpcode(), llvm::MachineInstr::getParent(), and MBB.
|
override |
Measure the specified inline asm to determine an approximation of its length.
Comments (which run till the next SeparatorString or newline) do not count as an instruction. Any other non-whitespace text is considered an instruction, with multiple instructions separated by SeparatorString or newlines. Variable-length instructions are not handled here; this function may be overloaded in the target code to do that. We implement the special case of the .space directive taking only an integer argument, which is the size in bytes. This is used for creating inline code spacing for testing purposes using inline assembly.
Definition at line 490 of file Mips16InstrInfo.cpp.
References llvm::StringRef::data(), llvm::dbgs(), DEBUG, llvm::MCAsmInfo::getCommentString(), llvm::MCAsmInfo::getMaxInstLength(), llvm::MCAsmInfo::getSeparatorString(), and llvm::StringRef::size().
GetOppositeBranchOpc - Return the inverse of the specified opcode, e.g.
turning BEQ to BNE.
Implements llvm::MipsInstrInfo.
Definition at line 143 of file Mips16InstrInfo.cpp.
References llvm_unreachable.
|
overridevirtual |
getRegisterInfo - 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).
Implements llvm::MipsInstrInfo.
Definition at line 35 of file Mips16InstrInfo.cpp.
Referenced by llvm::Mips16FrameLowering::determineCalleeSaves().
|
override |
isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot, return the virtual or physical register number of the destination along with the FrameIndex of the loaded stack slot.
If not, return 0. This predicate must return 0 if the instruction has any side effects other than loading from the stack slot.
Definition at line 44 of file Mips16InstrInfo.cpp.
|
override |
isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot, return the virtual or physical register number of the source reg along with the FrameIndex of the loaded stack slot.
If not, return 0. This predicate must return 0 if the instruction has any side effects other than storing to the stack slot.
Definition at line 54 of file Mips16InstrInfo.cpp.
| unsigned Mips16InstrInfo::loadImmediate | ( | unsigned | FrameReg, |
| int64_t | Imm, | ||
| MachineBasicBlock & | MBB, | ||
| MachineBasicBlock::iterator | II, | ||
| const DebugLoc & | DL, | ||
| unsigned & | NewImm | ||
| ) | const |
Emit a series of instructions to load an immediate.
This function generates the sequence of instructions needed to get the result of adding register REG and immediate IMM.
Definition at line 305 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), copyPhysReg(), llvm::RegScavenger::enterBasicBlock(), llvm::BitVector::find_first(), llvm::RegScavenger::forward(), llvm::MachineOperand::getReg(), llvm::RegScavenger::getRegsAvailable(), i, llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::RegState::Kill, llvm::BitVector::reset(), and T1.
|
overridevirtual |
Implements llvm::MipsInstrInfo.
Definition at line 109 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), assert(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MipsInstrInfo::GetMemOperand(), and llvm::MachineMemOperand::MOLoad.
| void Mips16InstrInfo::makeFrame | ( | unsigned | SP, |
| int64_t | FrameSize, | ||
| MachineBasicBlock & | MBB, | ||
| MachineBasicBlock::iterator | I | ||
| ) | const |
Definition at line 194 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), addSaveRestoreRegs(), BuildAddiuSpImm(), llvm::BuildMI(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), llvm::MipsRegisterInfo::getReservedRegs(), and llvm::isInt< 16 >().
Referenced by llvm::Mips16FrameLowering::emitPrologue().
| void Mips16InstrInfo::restoreFrame | ( | unsigned | SP, |
| int64_t | FrameSize, | ||
| MachineBasicBlock & | MBB, | ||
| MachineBasicBlock::iterator | I | ||
| ) | const |
Definition at line 224 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), addSaveRestoreRegs(), BuildAddiuSpImm(), llvm::BuildMI(), llvm::RegState::Define, llvm::MachineBasicBlock::end(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), llvm::MipsRegisterInfo::getReservedRegs(), and llvm::isInt< 16 >().
Referenced by llvm::Mips16FrameLowering::emitEpilogue().
|
overridevirtual |
Implements llvm::MipsInstrInfo.
Definition at line 91 of file Mips16InstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::getKillRegState(), llvm::MipsInstrInfo::GetMemOperand(), and llvm::MachineMemOperand::MOStore.
Definition at line 456 of file Mips16InstrInfo.cpp.
References llvm::isInt< 16 >(), llvm_unreachable, and PC.
|
inlinestatic |
Definition at line 91 of file Mips16InstrInfo.h.
Referenced by AddiuSpImm().
1.8.6