LLVM 20.0.0git
|
#include "Target/Mips/MipsInstrInfo.h"
Public Types | |
enum | BranchType { BT_None , BT_NoBranch , BT_Uncond , BT_Cond , BT_CondUncond , BT_Indirect } |
Static Public Member Functions | |
static const MipsInstrInfo * | create (MipsSubtarget &STI) |
Protected Member Functions | |
bool | isZeroImm (const MachineOperand &op) const |
MachineMemOperand * | GetMemOperand (MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const |
Protected Attributes | |
const MipsSubtarget & | Subtarget |
unsigned | UncondBrOpc |
Definition at line 41 of file MipsInstrInfo.h.
Enumerator | |
---|---|
BT_None | |
BT_NoBranch | |
BT_Uncond | |
BT_Cond | |
BT_CondUncond | |
BT_Indirect |
Definition at line 49 of file MipsInstrInfo.h.
|
explicit |
Definition at line 41 of file MipsInstrInfo.cpp.
|
pure virtual |
Implemented in llvm::Mips16InstrInfo, and llvm::MipsSEInstrInfo.
Referenced by llvm::MipsFrameLowering::eliminateCallFramePseudoInstr().
|
override |
Branch Analysis.
Definition at line 109 of file MipsInstrInfo.cpp.
References analyzeBranch(), BT_Indirect, BT_None, Cond, MBB, and TBB.
Referenced by analyzeBranch().
MipsInstrInfo::BranchType MipsInstrInfo::analyzeBranch | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock *& | TBB, | ||
MachineBasicBlock *& | FBB, | ||
SmallVectorImpl< MachineOperand > & | Cond, | ||
bool | AllowModify, | ||
SmallVectorImpl< MachineInstr * > & | BranchInstrs | ||
) | const |
Definition at line 205 of file MipsInstrInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), BT_Cond, BT_CondUncond, BT_Indirect, BT_NoBranch, BT_None, BT_Uncond, Cond, llvm::MachineInstr::eraseFromParent(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), I, llvm::SmallVectorImpl< T >::insert(), llvm::MachineInstr::isIndirectBranch(), llvm::MachineInstr::isUnconditionalBranch(), MBB, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineBasicBlock::rbegin(), llvm::MachineBasicBlock::rend(), and TBB.
|
static |
Definition at line 45 of file MipsInstrInfo.cpp.
References llvm::createMips16InstrInfo(), llvm::createMipsSEInstrInfo(), and llvm::MipsSubtarget::inMips16Mode().
|
override |
Definition at line 914 of file MipsInstrInfo.cpp.
|
override |
Definition at line 952 of file MipsInstrInfo.cpp.
References llvm::DIExpression::ApplyOffset, llvm::MachineOperand::CreateReg(), llvm::TargetInstrInfo::describeLoadedValue(), llvm::MDNode::get(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), isAddImmediate(), MI, llvm::Offset, llvm::DIExpression::prepend(), and TRI.
|
override |
Definition at line 786 of file MipsInstrInfo.cpp.
References assert(), llvm::TargetInstrInfo::findCommutedOpIndices(), llvm::MCInstrDesc::isCommutable(), and MI.
MachineInstrBuilder MipsInstrInfo::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.
Definition at line 700 of file MipsInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addSym(), llvm::BuildMI(), llvm::MachineInstrBuilder::cloneMemRefs(), llvm::MachineInstrBuilder::copyImplicitOps(), llvm::get(), llvm::MachineOperand::getMCSymbol(), llvm::MachineOperand::getTargetFlags(), I, llvm::MachineOperand::isMCSymbol(), llvm::MipsII::MO_JALR, llvm::MachineInstr::removeOperand(), and TRI.
unsigned MipsInstrInfo::getEquivalentCompactForm | ( | const MachineBasicBlock::iterator | I | ) | const |
Determine the opcode of a non-delay slot form for a branch if one exists.
Return the corresponding compact (no delay slot) form of a branch.
Definition at line 453 of file MipsInstrInfo.cpp.
References llvm::MipsSubtarget::getABI(), llvm::MipsABIInfo::GetZeroReg(), llvm::MipsSubtarget::hasMips32r6(), I, llvm::MipsSubtarget::inMicroMipsMode(), and Subtarget.
|
override |
Return the number of bytes of code the specified instruction may be.
Definition at line 682 of file MipsInstrInfo.cpp.
References llvm::TargetMachine::getMCAsmInfo(), llvm::MachineFunction::getTarget(), and MI.
|
protected |
Definition at line 80 of file MipsInstrInfo.cpp.
References llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), llvm::MachineBasicBlock::getParent(), and MBB.
Referenced by llvm::Mips16InstrInfo::loadRegFromStack(), llvm::MipsSEInstrInfo::loadRegFromStack(), llvm::Mips16InstrInfo::storeRegToStack(), and llvm::MipsSEInstrInfo::storeRegToStack().
Implemented in llvm::Mips16InstrInfo, and llvm::MipsSEInstrInfo.
Referenced by reverseBranchCondition().
|
pure virtual |
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).
Implemented in llvm::Mips16InstrInfo, and llvm::MipsSEInstrInfo.
|
override |
Definition at line 919 of file MipsInstrInfo.cpp.
bool MipsInstrInfo::HasForbiddenSlot | ( | const MachineInstr & | MI | ) | const |
Predicate to determine if an instruction has a forbidden slot.
Predicate for distingushing instructions that have forbidden slots.
Definition at line 642 of file MipsInstrInfo.cpp.
References llvm::MipsII::HasForbiddenSlot, and MI.
bool MipsInstrInfo::HasFPUDelaySlot | ( | const MachineInstr & | MI | ) | const |
Predicate to determine if an instruction has an FPU delay slot.
Predicate for distingushing instructions that have FPU delay slots.
Definition at line 647 of file MipsInstrInfo.cpp.
References MI.
Referenced by SafeInFPUDelaySlot().
bool MipsInstrInfo::HasLoadDelaySlot | ( | const MachineInstr & | MI | ) | const |
Predicate to determine if an instruction has a load delay slot.
Predicate for distingushing instructions that have load delay slots.
Definition at line 666 of file MipsInstrInfo.cpp.
References MI.
|
override |
Definition at line 135 of file MipsInstrInfo.cpp.
References llvm::MachineInstrBuilder::addMBB(), assert(), llvm::BuildMI(), Cond, DL, llvm::get(), MBB, TBB, and UncondBrOpc.
|
override |
Insert nop instruction when hazard condition is found.
insertNoop - If data hazard condition is found insert the target nop instruction.
Definition at line 58 of file MipsInstrInfo.cpp.
References llvm::BuildMI(), DL, llvm::get(), MBB, and MI.
MachineInstrBuilder MipsInstrInfo::insertNop | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
DebugLoc | DL | ||
) | const |
Insert an ISA appropriate nop
.
Definition at line 65 of file MipsInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::get(), llvm::MipsSubtarget::hasMips32r6(), llvm::MipsSubtarget::inMicroMipsMode(), llvm::MipsSubtarget::inMips16Mode(), MBB, MI, and Subtarget.
|
override |
Definition at line 980 of file MipsInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), and MI.
Referenced by describeLoadedValue().
Determine if the branch target is in range.
Definition at line 293 of file MipsInstrInfo.cpp.
References llvm_unreachable.
Reimplemented in llvm::MipsSEInstrInfo.
Definition at line 133 of file MipsInstrInfo.h.
bool MipsInstrInfo::IsMfloOrMfhi | ( | const MachineInstr & | MI | ) | const |
Definition at line 634 of file MipsInstrInfo.cpp.
References IsMFLOMFHI, and MI.
|
protected |
Definition at line 52 of file MipsInstrInfo.cpp.
References op.
Referenced by llvm::MipsSEInstrInfo::isLoadFromStackSlot(), and llvm::MipsSEInstrInfo::isStoreToStackSlot().
|
pure virtual |
Implemented in llvm::Mips16InstrInfo, and llvm::MipsSEInstrInfo.
Referenced by loadRegFromStackSlot().
|
inlineoverride |
Definition at line 149 of file MipsInstrInfo.h.
References loadRegFromStack(), MBB, MBBI, and TRI.
|
override |
Definition at line 169 of file MipsInstrInfo.cpp.
References assert(), I, MBB, llvm::MachineBasicBlock::rbegin(), and llvm::MachineBasicBlock::rend().
|
override |
reverseBranchCondition - Return the inverse opcode of the specified Branch instruction.
Definition at line 197 of file MipsInstrInfo.cpp.
References assert(), Cond, and getOppositeBranchOpc().
bool MipsInstrInfo::SafeAfterMflo | ( | const MachineInstr & | MI | ) | const |
Definition at line 575 of file MipsInstrInfo.cpp.
bool MipsInstrInfo::SafeInForbiddenSlot | ( | const MachineInstr & | MI | ) | const |
Predicate to determine if an instruction can go in a forbidden slot.
Predicate for distingushing between control transfer instructions and all other instructions for handling forbidden slots.
Consider inline assembly as unsafe as well.
Definition at line 585 of file MipsInstrInfo.cpp.
References llvm::MipsII::IsCTI, and MI.
bool MipsInstrInfo::SafeInFPUDelaySlot | ( | const MachineInstr & | MIInSlot, |
const MachineInstr & | FPUMI | ||
) | const |
Predicate to determine if an instruction can go in an FPU delay slot.
Definition at line 592 of file MipsInstrInfo.cpp.
References llvm::MachineInstr::defs(), llvm::MachineInstr::getOpcode(), HasFPUDelaySlot(), llvm::MachineInstr::isInlineAsm(), llvm::MachineInstr::readsWritesVirtualRegister(), and Writes.
bool MipsInstrInfo::SafeInLoadDelaySlot | ( | const MachineInstr & | MIInSlot, |
const MachineInstr & | LoadMI | ||
) | const |
Predicate to determine if an instruction can go in a load delay slot.
Predicate for distinguishing instructions that are hazardous in a load delay slot.
Consider inline assembly as unsafe as well.
Definition at line 624 of file MipsInstrInfo.cpp.
References llvm::any_of(), llvm::MachineInstr::defs(), and llvm::MachineInstr::isInlineAsm().
|
pure virtual |
Implemented in llvm::Mips16InstrInfo, and llvm::MipsSEInstrInfo.
Referenced by storeRegToStackSlot().
|
inlineoverride |
Definition at line 140 of file MipsInstrInfo.h.
References MBB, MBBI, storeRegToStack(), and TRI.
|
override |
Perform target specific instruction verification.
Definition at line 865 of file MipsInstrInfo.cpp.
References MI, Subtarget, llvm::MipsSubtarget::useIndirectJumpsHazard(), and verifyInsExtInstruction().
|
protected |
Definition at line 45 of file MipsInstrInfo.h.
Referenced by llvm::MipsSEInstrInfo::adjustStackPtr(), llvm::MipsSEInstrInfo::copyPhysReg(), llvm::MipsSEInstrInfo::expandPostRAPseudo(), getEquivalentCompactForm(), insertNop(), llvm::MipsSEInstrInfo::loadImmediate(), llvm::MipsSEInstrInfo::loadRegFromStack(), and verifyInstruction().
|
protected |
Definition at line 46 of file MipsInstrInfo.h.
Referenced by insertBranch().